let
Source = Folder.Files("C:\Users\jdell\Dropbox\Excel\MyOnlineTrainingHub\excel_dashboard_dark_theme_db_dl\Data"),
// Added to insure all extensions were lower case.
LowercasedText = Table.TransformColumns(Source,{{"Extension", Text.Lower, type text}}),
// Added to insure only .csv files were being handled. More could be done with the Name column to insure no stray files are included.
FilteredRows = Table.SelectRows(LowercasedText, each [Extension] = ".csv"),
RemovedOtherColumns = Table.SelectColumns(FilteredRows,{"Name", "Content"}),
// To prepare to get the last two characters of the Name column.
ReplacedValue = Table.ReplaceValue(RemovedOtherColumns,".csv","",Replacer.ReplaceText,{"Name"}),
InsertedFirstCharacters = Table.AddColumn(ReplacedValue, "Year", each Text.Start([Name], 4), type text),
InsertedLastCharacters = Table.AddColumn(InsertedFirstCharacters, "Month", each Text.End([Name], 2), type text),
RemovedColumns = Table.RemoveColumns(InsertedLastCharacters,{"Name"}),
ReorderedColumns = Table.ReorderColumns(RemovedColumns,{"Year", "Month", "Content"}),
// Auto Generated
FilteredHiddenFiles1 = Table.SelectRows(ReorderedColumns, each [Attributes]?[Hidden]? <> true),
// Auto Generated
InvokeCustomFunction1 = Table.AddColumn(FilteredHiddenFiles1, "Transform File", each #"Transform File"([Content])),
// Auto Generated BUT added "Year", "Month", manually to keep them.
RemovedOtherColumns1 = Table.SelectColumns(InvokeCustomFunction1, {"Year", "Month", "Transform File"}),
ExpandedTransformFile = Table.ExpandTableColumn(RemovedOtherColumns1, "Transform File", {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9"}, {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9"})
in
ExpandedTransformFile