Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
amit_n
Contributor
Contributor

Validate the CSV file schema dynamically?

Please let me know how to validate the csv file schema dynamically. Please let me know any one have implemented this in Talend open studio.

Labels (4)
12 Replies
fdenis
Master
Master

open csv file adding one column more.
this one have to be empty.
amit_n
Contributor
Contributor
Author

Please can you explain briefly. 

fdenis
Master
Master

in a csv file

col1;col2;col3

a;b;c

if you open and get the first line (column name)

you an count column (=3)

 

on a second time if you read a line like this one: e;f;g;h

there is something wrong.

 

a csv file (first level) is never invalid col1=e col2=f col3=g;h

you can add coma enclosure (CSV Options)

 

the same line can be wrong

"e";"f";"g";"h" --> ???

"e";"f";"g;h" --> ok

 

think about what is an invalid csv file?

 

that's all

 

amit_n
Contributor
Contributor
Author

Sure . Let me try and get back to u. Thank You.

amit_n
Contributor
Contributor
Author

@fdenis

Please let me know if u have created any sample job for this. So i can create the job based on that.

 

 

fdenis
Master
Master

I can not share pics.
but you are going to success.
amit_n
Contributor
Contributor
Author

Actually my file headers are

emp_id,name,lastname,age,designation

evrytime the column positions will be changing. we dont know how the columns will be in csv file. So how can we achive in this position. We need to validated column header dynamically.

fdenis
Master
Master

read csv using dynamic type then using java, check all columns are present , then re-order then.
amit_n
Contributor
Contributor
Author

@fdenis

I am not able to make the column as dynamic type. can u share the java code to check all the columns are present.