- let
- Source = Text.Remove(Excel.CurrentWorkbook(){[Name="mypath"]}[Content][文件地址]{0},{"[","]"}),
- Custom1 = Table.FirstN(Table.Skip(Table.SelectRows(Excel.Workbook(File.Contents(Source)),each [Kind]="Sheet"),3),31),
- addressList = {{4,6},{5,6},{8,3},{8,8},{10,3},{10,8},{12,2},
- {27,3},{28,3},{29,3},{30,3},{31,3},{32,3},
- {27,6},{28,6},{29,6},{30,6},{31,6},{32,6},
- {27,9},{28,9},{29,9},{32,9},
- {34,3},{35,3},{36,3},{37,3},
- {34,6},{35,6},{36,6},{37,6},
- {34,9},{35,9},{37,9},
- {39,3},{40,3},
- {39,6},{40,6},
- {39,9},{40,9},
- {42,3},{42,6},{42,9}
- },
- Custom2 = Table.FromRows(List.Transform(Custom1[Data],each List.Transform(addressList,(x)=>Table.ToRows(_){x{0}-1}{x{1}-2})),
- List.Transform(addressList,(x)=>try Table.ToRows(Custom1[Data]{0}){x{0}-1}{x{1}-3} otherwise Text.From(x{0}*100+x{1}))),
- #"Changed Type" = Table.TransformColumnTypes(Custom2,{{"鉴定日期:", type date}})
- in
- #"Changed Type"
复制代码 |