- let
- 源 = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
- 转换 = Table.AddColumn(源, "自定义", each List.Generate(()=>[a=[16进制],b=Text.Length(a),c=(if List.Contains({"A".."F"}, Text.Range(a,0,1)) then Character.ToNumber(Text.Range(a,0,1))-55 else Number.From(Text.Range(a,0,1)))*Number.Power(16,b-1)] ,each _[b]>0,each [a=Text.Range(_[a],1),b=_[b]-1,c=(if List.Contains({"A".."F"}, Text.Range(a,0,1)) then Character.ToNumber(Text.Range(a,0,1))-55 else Number.From(Text.Range(a,0,1)))*Number.Power(16,b-1)],each _[c])),
- 结果 = Table.AddColumn(转换, "结果", each List.Transform({List.Sum([自定义])},each Text.Format("#{0}-#{1}-#{2}", {"460-00",Number.IntegerDivide(_,256),Number.Mod(_,256)})){0})[结果]
- in
- 结果
复制代码
我这个错在哪?
|