Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Sanjay5
Contributor III
Contributor III

how to copy footer line in output file

Hi,

 

I am using tFileInputDelimited and set Footer = 1, When i run job to copy all the rows including Footer to output file, Footer it not getting copied. I am using using tFileOutputDelimited.

 

Is there any way to copy Footer into output file. 

Labels (4)
3 Replies
Anonymous
Not applicable

Hi,

 

    You can read the footer alone in a different subjob. The first step you will have to do is to capture the number of lines in the previous subjob. This can be captured by the global variable NB_LINE.

 

NB_LINE: the number of rows processed. This is an After variable and it returns an integer.

Once the first subjob is over, the value will be available to this global variable.

 

You can add this value of NB_LINE in the header section of the tFileInputDelimited component in second subjob, which will be used to read only footer. Make sure that in the second job, the footer value is default value.

 

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

Sanjay5
Contributor III
Contributor III
Author

Hi Nikhil,

 

Thanks for the approach, This would work, However it is very complicated process just to get footer in output file. My purpose is to get all the rows in output file not just footer, This would need multiple steps to get all the rows in one single file. I agree that it will work somehow, Just that it is complicated.

 

I was thinking if there is any setting in tFileinputDelimited component to not ignore footer. 

Anonymous
Not applicable

Hi,

 

   Another approach will be to read including footer in the original file and pass it to a tMap where you can add a sequence number for each row. The footer will have obviously the maximum value of the sequence number. You can take this record for further processing. 

 

   But in case your footer is having different schema, you may have to pass full row as single input string to add additional sequence or a dynamic schema. But my personal preference will be earlier method and I don't think its complicated.

 

   There is no capability of simultaneous data and footer processing capability in tFileInputDelimited component.

 

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