- let
Source = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
a = Table.TransformColumnTypes(Source,{{"原始数据", type text}}),
b = Table.AddColumn(a,"替换结果",each Text.Combine([x=Text.Split([原始数据],"-"),y=List.Transform({0..List.Count(x)-1},each if (x{_}="S" and _=0) or (Text.Start(x{_},1)="M" and _=List.Count(x)-1) then null else x{_})][y],"-"))
in
b
复制代码 |