0
votes

I have a set of 30 csv files, which I consolidate in Excel via PowerQuery (Get External Data --> From Folder)

From time to time there will be added some new columns in the source csv files.

Unfortunately those new columns do not appear in the consolidated excel or in PowerQuery. After creating a new data query, the new columns are visible but I am not able to edit the existing data query so that the new columns appear. Via PowerQuery Editor I could add some columns, but I am not able to select one of the new ones.

Does anyone have a clue?

Here are the first lines of my query (system language is german unfortunately):

let
    Quelle = Folder.Files("\\MySource"),
    #"Gefilterte Zeilen" = Table.SelectRows(Quelle, each ([Extension] = ".csv")),
    #"Gefilterte ausgeblendete Dateien1" = Table.SelectRows(#"Gefilterte Zeilen", each [Attributes]?[Hidden]? <> true),
    #"Benutzerdefinierte Funktion aufrufen1" = Table.AddColumn(#"Gefilterte ausgeblendete Dateien1", "Datei transformieren (3)", each #"Datei transformieren (3)"([Content])),
    #"Umbenannte Spalten1" = Table.RenameColumns(#"Benutzerdefinierte Funktion aufrufen1", {"Name", "Source.Name"}),
    #"Andere entfernte Spalten1" = Table.SelectColumns(#"Umbenannte Spalten1", {"Source.Name", "Datei transformieren (3)"}),
    #"Erweiterte Tabellenspalte1" = Table.ExpandTableColumn(#"Andere entfernte Spalten1", "Datei transformieren (3)", Table.ColumnNames(#"Datei transformieren (3)"(#"Beispieldatei (3)"))),
1

1 Answers

0
votes

Look for code similar to

Source = Csv.Document(File.Contents("C:\TEMP\5.csv"),[Delimiter=",", Columns=6, Encoding=1252, QuoteStyle=QuoteStyle.None])

and remove the

, Columns=6

part so that you get

Source = Csv.Document(File.Contents("C:\TEMP\5.csv"),[Delimiter=",", Encoding=1252, QuoteStyle=QuoteStyle.None])