Flat file schema-multiple details-no rec id

Hi Everyone. I cannot figure out how to do this and how this works. See the below data (very simplified, but I believe mirrors my issue):

|JOE|ROBERTS|3|4555|1.50|CHAINS|4556|1.55|NUTS|4557|1.60|BOLTS|3.65|END|

okay:

|JOE|ROBERTS|3 <== Header (1 only), the last field “3” represents how many line items will follow

|4555|1.50|CHAINS|4556|1.55|NUTS|4557|1.60|BOLTS <== represents the 3 line items (could have 3 details, could have 200, it is unlimited)

|3.65|END| <=== Footer (1 only)

I cannot figure out how to properly set this up. I think I’m having the most issues trying to figure out how to handle the line item situation. How do you set up the schema so that in that one continuous pipe delimited line, the parser will know that there are 3 line items in it and where each detail line starts and stops.

I’ve set up a flat file dictionary whereas there are 3 different sections: one for the Header, one for the Detail, and one for the footer.

The schema was set up so that the detail line’s max repeat is unlimited. In Flat File definition -> delimiter was selected; record is setup as newline and subfield is setup as |. Yet I continue to get “No Valid Record” errors.

Can someone please help me with this?

hi,
The line item that you trying to parse is wrong…
4555|1.50|CHAINS|4556|1.55|NUTS|4557|1.60|BOLTS

It is not possible to have same symbol as Record delimiter and Field Delimiter… Its not a valid flat file… It should be different…

In the above case, you know each record is having 3 fields and so you expect the parser to generate 3 records with 3 fields inside it…

The way flatfile adapter identifies it is, there are totally 9 records separated by ‘|’ character with each record having one field…

Senthil is saying correct…

I suggest you to first go thru the pdf file “FlatFileSchemeDevGuide.pdf” to understand what is field and what is record and how parser reads the flat file and parser uses delimiters. It will give you great understanding.

Thanks,