Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I want to develop a Job to read CSV files from a folder and display the results in the same order always.
The problem is, there's no fixed schema for these files.
I mean, the files may come with different schemas:
... any possible combination.
My question is: can the Job be dynamic enough so that, no matter the order of the columns, the files always gets read and the results displayed in the right order (A, B, C, D)?
Thank you so much,
Rui
Hi there,
I've found a solution.
For each CSV file tFileList finds, I do this:
1- tFileInputDelimited
2- tExtractDynamicFields
3- tDBOutput
This way, no matter what comes in the CSV file, my Job will only consider what values come in these 4 columns. And if one or more of these columns are missing, the Job considers that column with the value "null".
Hope this helps someone.
Thank you.
Hello
You need to use Dynamic schema, you have a similar requirement as described in this KB article.
Regards
Shong
Hi @Shicong Hong ,
I will have a look RIGHT NOW!
Thank you
The link is inaccessible. 😮
@Rui Motta , sorry, I didn't notice that the article is only visible for internal staffs, let me think about what I can do, or I can do my best to provide an example.
Hi there,
I've found a solution.
For each CSV file tFileList finds, I do this:
1- tFileInputDelimited
2- tExtractDynamicFields
3- tDBOutput
This way, no matter what comes in the CSV file, my Job will only consider what values come in these 4 columns. And if one or more of these columns are missing, the Job considers that column with the value "null".
Hope this helps someone.
Thank you.
It is a good solution! Thank you for your sharing! @Rui Motta
Regards
Shong
My pleasure.
Rui