Re: Flat File Parsing



Thanks a lot Greg! Worked just as you said.

Greatly Appreciate your effort.

Thanks,

Sandeep.

"Greg Forsythe" wrote:

This is a the basic record structure, you will need to add the field
elements to each record with a Tag Identifier

File (delimiter 0x0D 0x0A Postfix)
--FileRecord (Tag 01, delimiter "," Prefix)
--Group (delimiter 0x0D 0x0A Infix, MaxOccurs = unbounded)
----Header1 (Tag 02, delimiter "," Prefix)
----Header2 (Tag 03, delimiter "," Prefix)
----Detail (delimiter 0x0D 0x0A Infix, MaxOccurs = unbounded)
------DetailRecord (Tag 16, delimiter "," Prefix)
------AdditionalDetails (Tag 88, , delimiter "," Prefix, MaxOccurs =
unbounded)
----GroupTrailer1 (Tag 49, , delimiter "," Prefix)
----GroupTrailer2 (Tag 98, , delimiter "," Prefix)
--FileTrailer (Tag 99, delimiter "," Prefix)

Greg

"Sandeep" <Sandeep@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:173BCA36-3FCF-4968-8061-229FF8B49C6C@xxxxxxxxxxxxxxxx
Hi Everyone,

I have a flat file with the following format -

01,1,2,3,4,5,6,7,8
02,1,2,3,4,5,6,7,8
03,1,2,3,4,5,6,7,8
16,100,C100,3333,5555
88,sss,444,333,5555
88,yyy,333,444,5555
16,200,d100,3333,4444
88,sss,444,333,5555
88,yyy,333,444,5555
49,1,2,3
98,1,2,3
02,1,2,3,4,5,6,7,8
03,1,2,3,4,5,6,7,8
16,300,e100,6333,7555
88,tss,244,333,5555
88,zyy,343,444,5555
49,1,2,3
98,1,2,3
99,1,2,3


-> 01 is the file header record, always 1 per file
-> 02 is the group header 1
-> 03 is the group header 2
-> 16 is the detail record - each group can have multiple 16 records
-> 88 is the additional detail record - each 16 records can have multiple
88
records
-> 49 is the group trailer 1 - one 49 record per 03 record
-> 98 is the group trailer 2 record - one 98 record per 02 record
-> 99 is the file trailer, always 1 per file

Any directions or pointers is greatly appreciated.

Thanks.



.


Loading