One Star

[CSV] How to link Column Names in Schema and Header?

Hi!
I've got a question regarding tfileinputdelimited and their schemas, i made a simple job :

Both input read the same file, this one :

(A tab separated value file)
Here are the schemas of my two inputs :
http://i.imgur.com/nzQkzJ2.png http://i.imgur.com/hSNE6n0.png

And here's the output :


As you can see, in the second output, the values are wrong.
The components does not link the value and their header names (provided in the file) to the names specified in the schema, as a mysqlinput component would do, but instead read them in the order they come.
The output of my tLogRow_2 component should read "HO | HU" (second and third columns), not "Hi, HO". Is there a way to link header column names in file and columns names in schemas?

Here are the job's components if you want to test it, thank you very much :
TestJob.zip_20160630-2351.zip
4 REPLIES
Five Stars

Re: [CSV] How to link Column Names in Schema and Header?

The CSV file is read by position.
If you're expecting your input files to have columns out of order and you want to match up using header names, this component will not do this for you.
One Star

Re: [CSV] How to link Column Names in Schema and Header?

Thank your for your answer. Should i use another component, or will the csv format prevent me from doing this, regardless of the technique used?
Five Stars

Re: [CSV] How to link Column Names in Schema and Header?

It's unclear what you're trying to do.
Is your use case that you have to read CSV files that have columns in an unpredictable order?
Ideally, this should not happen. If it is, then I think you'd have to do you're own parsing of the input data to assign the correct inputs to the correct outputs.
Fifteen Stars

Re: [CSV] How to link Column Names in Schema and Header?

It looks like this tutorial might be what you need (https://www.rilhia.com/tutorials/dynamic-column-order). This shows how you can handle a dynamic column order with the Open Source product.
Rilhia Solutions