Page 1 of 1

Reading file with multiple header and trailer

Posted: Tue Jun 17, 2008 9:47 am
by wahi80
Hi,

I have an input file which has following format

Code: Select all

Header1
Det Records1 (Width 80)
Trailer1
Header2
Det Records2 (Width 80)
Trailer2
Header3
Det Records3 (Width 80)
Trailer3
All detail records are width 80,but within each set there are different coulmn widths

e.g Det Record1 can have 4 coulmns, whereas DEt Record2 can have 8 columns

How do I read this file?

Regards
Wah

Re: Reading file with multiple header and trailer

Posted: Tue Jun 17, 2008 1:44 pm
by Krazykoolrohit
wahi80 wrote:

Code: Select all

Header1
Det Records1 (Width 80)
Trailer1
Header2
Det Records2 (Width 80)
Trailer2
Header3
Det Records3 (Width 80)
Trailer3
Read each line as one record into a column1 defined as varchar 200.

Use a tranformer to sort the rows out into various links. you can build the logic inside transfomer that says that if column1 = "Header1" then send next 2 records to link1.