Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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 🙂
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 🙂