Forum Discussion
M query using folder.contents questions
- Anonymous4 years ago
Spread out the files into different folders
- Anonymous4 years ago
let
Source = Table.FromColumns({Lines.FromBinary(File.Contents("D:\folder\index.txt"), null, null, 936)}),
#"Filtered Rows" = Table.SelectRows(Source, each Text.StartsWith([Column1], "wanted")),
#"Added Custom" = Table.AddColumn(#"Filtered Rows", "path", each "D:\folder\" & [Column1]),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Content", each File.Contents([path]))
in
#"Added Custom1"
Hi GSun,
Thanks for your quick turnaround.
I am not the owner of the files and not the option to spread the files.
For your second suggestions, how can I make it in M query to only load the files I need?
Thanks,
W
let
Source = Table.FromColumns({Lines.FromBinary(File.Contents("D:\folder\index.txt"), null, null, 936)}),
#"Filtered Rows" = Table.SelectRows(Source, each Text.StartsWith([Column1], "wanted")),
#"Added Custom" = Table.AddColumn(#"Filtered Rows", "path", each "D:\folder\" & [Column1]),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Content", each File.Contents([path]))
in
#"Added Custom1"
- Mrquestionmark4 years agoHelper I
Hi Gsun,
This is smart. It worked.
Thans for your help!
W