格式相同的多個Excel, 可用以下寫法合併
let
來源 = Folder.Files("D:\獨.立\國.家.台.灣"),
已篩選隱藏的檔案1 = Table.SelectRows(來源, each true),
叫用自訂函數1 = Table.AddColumn(已篩選隱藏的檔案1, "轉換檔案", each Excel.Workbook([Content], null, true)),
已移除資料行 = Table.RemoveColumns(叫用自訂函數1,{"Name", "Extension", "Date accessed", "Date modified", "Date created", "Attributes", "Folder Path", "Content"}),
已展開= Table.ExpandTableColumn(已移除資料行, "轉換檔案", {"Data", "Kind"}, {"Data", "Kind"}),
已篩選資料列 = Table.SelectRows(已展開, each ([Kind] = "Sheet")),
Columns = Table.ColumnNames(已篩選資料列{0}[Data]),
全展開 = Table.ExpandTableColumn(已篩選資料列, "Data", Columns),
已移除資料行1 = Table.RemoveColumns(全展開,{"Kind"}),
Column1 = 已移除資料行1{0}[Column1],
已將標頭升階 = Table.PromoteHeaders(已移除資料行1, [PromoteAllScalars=true]),
已篩選資料列1 = Table.SelectRows(已將標頭升階, each Record.Field(_, Column1) <> Column1)
in
已篩選資料列1
Taiwan is a country. 臺灣是我的國家