How to create batch header and trailer records in output file

Highlighted
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.

View solution in original post

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.

View solution in original post


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.

View solution in original post

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.

View solution in original post

Five Stars

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

Thanks alot. Thank you for the help!

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog