ComplexDataReader help

Hi there,

How do we read a flat file that has multiple types, but the data is specified on each row, not on the next rows? I was trying to follow the example from http://blog.cloveretl.com/processing-heterogeneous-data-with-complexdatareader, but that example uses a “batch” row that tells what kind of data is coming on the next rows. My data looks like this:


H0001This is the header information12345etcetc
S0000001This is the batch start       11111
D0000001001The detail record 99Jeaux Bleaux 3297etcetc
D0000001002Next detail record98Jahnh Deaux 4588etc
F0000001This is the batch finish6432etc
S0000002This is the next batch start23422
D0000002001The detail record 55Inigo Montoya2237etcetc
...

Thanks so much for your help!
Jus

Hi Jus,

I expect your data was harmed during pasting to forum, and they should look like (I used | as separator):


H0001|This is the header information|12345|etcetc
S0000001|This is the batch start|11111
D0000001001|The detail record|99|Jeaux Bleaux|3297|etcetc
D0000001002|Next detail record|98|Jahnh Deaux|4588|etc
F0000001|This is the batch finish|6432|etc
S0000002|This is the next batch start|23422
D0000002001|The detail record|55|Inigo Montoya|2237|etcetc


Your data are basically great use case for our ComplexDataReader. See atached graph for sample.

(All record types are send to separate outputs, ‘detail’ items are enriched by batch id)

Awesome! Thanks Jaroslav!