Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Guys,
my current code loads two fields from one csv-file.
LOAD
FIELD_A,
FIELD_B
FROM [lib://DATA_Public/EXPORT_A.csv]
(txt, codepage is 28591, no labels, delimiter is ';', msq);
Main_Tab:
Load
FIELD_A,
FIELD_B
Resident Main_Tab_Temp
Group by FIELD_A, FIELD_B;
Drop Table Main_Tab_Temp;
Now i want it to load these fields from two csv files ("EXPORT_A" and "EXPORT_B") instead of one.
The fields have the same names in both csv files.
How do i need to change the code?
If the tables have exactly same column names it will auto-concatenate/union. But I always prefer to explicitly write concatenate like below. Is below what you're looking for?
You can also do this is you know the file structures are all the same with the wildcard search.
FROM [lib://DATA_Public/EXPORT_*.csv]
Main_Tab_Temp:
LOAD
FIELD_A,
FIELD_B
FROM [lib://DATA_Public/EXPORT_A.csv]
(txt, codepage is 28591, no labels, delimiter is ';', msq);
Concatenate(Main_Tab_Temp)
LOAD
FIELD_A,
FIELD_B
FROM [lib://DATA_Public/EXPORT_B.csv]
(txt, codepage is 28591, no labels, delimiter is ';', msq);
Main_Tab:
Load
FIELD_A,
FIELD_B
Resident Main_Tab_Temp
Group by FIELD_A, FIELD_B;
Drop Table Main_Tab_Temp;
If the tables have exactly same column names it will auto-concatenate/union. But I always prefer to explicitly write concatenate like below. Is below what you're looking for?
You can also do this is you know the file structures are all the same with the wildcard search.
FROM [lib://DATA_Public/EXPORT_*.csv]
Main_Tab_Temp:
LOAD
FIELD_A,
FIELD_B
FROM [lib://DATA_Public/EXPORT_A.csv]
(txt, codepage is 28591, no labels, delimiter is ';', msq);
Concatenate(Main_Tab_Temp)
LOAD
FIELD_A,
FIELD_B
FROM [lib://DATA_Public/EXPORT_B.csv]
(txt, codepage is 28591, no labels, delimiter is ';', msq);
Main_Tab:
Load
FIELD_A,
FIELD_B
Resident Main_Tab_Temp
Group by FIELD_A, FIELD_B;
Drop Table Main_Tab_Temp;
Thanks!!