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

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
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.
Community Manager

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.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now