- // output
let
Source = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
splitCol = Table.SplitColumn(Source, "源", fnSplit, {"年", "月", "描述"})
in
splitCol
// fnType
let
Source = (t)=>if t="年" or t="月" then Number.Type else Value.Type(Value.FromText(t))
in
Source
// fnSplit
(str)=>
let
tolist = Text.ToList(str&"'"),
acc = List.Accumulate(
tolist,
{"", "", {}},
(s,c)=>if c = "'" or (fnType(s{0})fnType(c))
then {c, c, if fnType(s{0})=Text.Type then s{2}&{s{1}} else {s{1}}&s{2}}
else{c, s{1}&(if s{0} = "年" then "-" else "") &c, s{2}}
){2},
otlist = let lst=Text.Split(acc{0}, "-") in {lst{0}}&{lst{1}? ??"无"}&{acc{2}}
in
otlist
复制代码 可以试试我的这个
10847111524508.rar
(16.07 KB, 下载次数: 0)
|