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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
npatel
Contributor
Contributor

[resolved] Validating headers from file

We have a job set up to import data from csv file in database. But since the client data file is not always consistent, I want to have column sequence validation.
For example, 
Actual file :
Address,Name, Email, Phone1, Phone2
Inconsistent file :
Name,Email,Address,Phone1,Phone2
I am looking to import the file only if the sequence is correct else reject that file.
Is there a component in Talend which allows to validate column names ? 
I know people have suggested to read first line (headers) and compare it using tjava. Is there any other way to validate the sequence of columns from file without hard-coding it in tjava ?
Labels (4)
3 Replies
Anonymous
Not applicable

Hi 
No component can do this, you still need to read the first line and write a simple Java code to validate it, I think writing a Java code to validate is more simpler than writing a component to do it.
Shong
Anonymous
Not applicable

I think you are looking for something Validate CSV Headers


check this link for how to achieve it. 
npatel
Contributor
Contributor
Author

Thanks Shong and Umesh.