Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to read postional files with header and trailer records

I have sample file like below : 

where 00 is the header and underneath are child records till the next occurrence of 00 record . 
I need to same aggregation/cacluation for child records with respect to its header record.  Is there any out of the box solution for processing such types of file in Talend . Would like to know how to approach this from development perspective in  Talend

00,,,,,EUR,1,,,,,TRANSFER-EUR,797289,18092018
01,ACQUIRED CARDS SUB,,,,102,,7112.81,,0,7112.81,,797289,18092018
03,CHARGEBACKS SUB,,,,0,,0,,0,0,,797289,18092018
06,SETTLEMENT AMOUNT,,,,,,,,,7112.81,,797289,18092018
00,,,,,EUR,1,,,,,TRANSFER-EUR,893505,18092018
01,ACQUIRED CARDS SUB,,,,21,,1142.53,,0,1142.53,,893505,18092018
03,CHARGEBACKS SUB,,,,0,,0,,0,0,,893505,18092018
06,SETTLEMENT AMOUNT,,,,,,,,,1142.53,,893505,18092018

Labels (2)
1 Reply
Anonymous
Not applicable
Author

You can use the tFileInputMSDelimited component. It is a bit tricky to get your head around if you've never used it before, but it will allow you to split out these rows for processing. In order to keep them "linked" if there are no other keys, you could assign each of the outputs (there will be a row type for every record type) a sequence number using a tMap, then output to tHashOutput components. Then in a subsequent subjob, you could read back in the data from your tHashInput holding your header rows, join them together with the other datasets (using other tHashInput components) using your sequence numbers, then carry out the processing in a tMap.

tFileInputMSDelimited ---> tMap ---> tHashOutput_1
|                                    ---> tMap ---> tHashOutput_2
|                                    ---> tMap ---> tHashOutput_3
|                                    ---> tMap ---> tHashOutput_4
|
|
|                                  tHashInput_2
|                                  tHashInput_3
|                                  tHashInput_4
|                                  |
tHashInput_1 --------> tMap --------------> {Joined Data}