Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm loading hundresds of CSV files into one QVD by using:
LOAD *
FROM (FilePath)*.CSV
It works fine if they all have same column names but if any of these has an additioanl column then I get synethetis keys. Is there a way to have them in one QVD and still avoid synthetic keys?
Use the concatenate keyword to force the data to be appended to the same table:
// set the FilePath variable
SET FilePath = 'D:\QVdata\temp\comm75615\';
// create an empty table to concatenate to
load '' as TempField AutoGenerate 0;
concatenate load *
from $(FilePath)*.CSV
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);;
// drop superfluous field
drop field TempField;
edit: added some details to make the example more complete
Use the concatenate keyword to force the data to be appended to the same table:
// set the FilePath variable
SET FilePath = 'D:\QVdata\temp\comm75615\';
// create an empty table to concatenate to
load '' as TempField AutoGenerate 0;
concatenate load *
from $(FilePath)*.CSV
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);;
// drop superfluous field
drop field TempField;
edit: added some details to make the example more complete
With that script, it only loads the very first CSV file and I get "execution of script failed" message.
Thank you.