Skip to content

Instantly share code, notes, and snippets.

@migueesc123
Created October 28, 2019 07:38
Show Gist options
  • Save migueesc123/a58ff895a58c69f8141bcd8eef030491 to your computer and use it in GitHub Desktop.
Save migueesc123/a58ff895a58c69f8141bcd8eef030491 to your computer and use it in GitHub Desktop.
(myFolderPath as text) as table =>
let
Source = Folder.Files(myFolderPath),
#"Removed Other Columns" = Table.SelectColumns(Source,{"Content"}),
Content = #"Removed Other Columns"[Content],
Custom1 = Binary.Combine(Content),
Custom2 = Csv.Document (Custom1)
in
try Custom2 otherwise error [Reason="Transformation Exception", Message="The data that you're trying to combine does not appear to be a flat file", Detail="Make sure that you're only combining csv, txt or other flat files"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment