How to create batch header and trailer records in output file

Five Stars

How to create batch header and trailer records in output file

Hi,

 

How to create Batch header and trailer with detail records

Input is single file for example

ID,Name1,Name2

10,a1,a2

10,b1,b2

20,c1,c2

20,d1,d2

20,e1,e2

 

Output be like

B10

Da1a2

Db1b2

T10

B20

DC1C2

Dd1d2

De1e2

T20

 

How can we achieve this? Please help

Thanks in advance


Accepted Solutions
Community Manager

Re: How to create batch header and trailer records in output file

I'm assuming the batches are identified by the ID. If that is the case, this is relatively easy. However, it is a little complicated to explain quickly and I do not have a great deal of time right now. So I have knocked up an example (it's quicker to do than explain) in v6.5.1. Take a look at this and see if you can work with it. You may need to download Talend 6.5.1 to use this if you aren't using that version.

Community Manager

Re: How to create batch header and trailer records in output file

You can do this with a tAggregateRow component. I believe you can just add the calculation (count) into one of the ones I put into the job....I don't have it here at the moment and am not using 6.5 so I can't look at it.


All Replies
Community Manager

Re: How to create batch header and trailer records in output file

I'm assuming the batches are identified by the ID. If that is the case, this is relatively easy. However, it is a little complicated to explain quickly and I do not have a great deal of time right now. So I have knocked up an example (it's quicker to do than explain) in v6.5.1. Take a look at this and see if you can work with it. You may need to download Talend 6.5.1 to use this if you aren't using that version.

Five Stars

Re: How to create batch header and trailer records in output file

THANK YOU SO MUCH. It is working. Thanks alot.

is there any way to get Count of number of records per each group to append to Trailer Record for every batch?

 

 

 

 

Thanks in advance

Community Manager

Re: How to create batch header and trailer records in output file

You can do this with a tAggregateRow component. I believe you can just add the calculation (count) into one of the ones I put into the job....I don't have it here at the moment and am not using 6.5 so I can't look at it.

Five Stars

Re: How to create batch header and trailer records in output file

Thanks alot. Thank you for the help!

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch