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

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Varying Header Size

I have datasheet text documents that I am inputting with tFileInputDelimited. They are formatted the same way, but their headers vary in number of lines. However, the end of the header is always signified by the same string, "Results". Is is possible to signify the end of a header with a string, instead of specifying the number of lines of the header?

 

PS I am very new to Talend and am using v 4.1.1

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

 

   One method is to read the file first time with 0 header and parse the data using Java functions to check whether the string "Results" is present. You can note the line number (you can create a numeric sequence in tMap to add additional line number column) of the row where this string comes and note it to a context variable.

 

   Then you will have to read the file second time and this time, provide the header number from context variable instead of default value of 0. Then you can read the data from that row onwards. The flip side is that you are reading the file twice.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hi,

 

   One method is to read the file first time with 0 header and parse the data using Java functions to check whether the string "Results" is present. You can note the line number (you can create a numeric sequence in tMap to add additional line number column) of the row where this string comes and note it to a context variable.

 

   Then you will have to read the file second time and this time, provide the header number from context variable instead of default value of 0. Then you can read the data from that row onwards. The flip side is that you are reading the file twice.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

Anonymous
Not applicable
Author

Thank you, this worked very well!