cancel
Showing results for 
Search instead for 
Did you mean: 

Reading a flat file without key fields

Former Member
0 Kudos

Hi,

My File Sender MT looks like this:

Root: 1..1

Header: 1..1

Row: 1..1

Body: 1..Unbound

Row: 1..1

Trailer: 1..1

Row: 1..1

Using this File Sender i want to read a flat file which has Header (1 row), Body (unknown rows) and Trailer (1 row), each kin of row has different field lengths.

The problem is that i don't have any Key Field to fit the file to the Recordset Structure: Header,1,Body,*,Trailer,1

What can i do??

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

yigal then by you cant do it by stand file adapter. as you dont have keyfeild values file adapter cant diffrenate between header,row,body.

Former Member
0 Kudos

Hi Abel,

If you are not having key fields and unable to read through adapter,

1) Read the entire file into one string through adapter

2) Must use java mapping program to split the the string into expected format according lengths.

Thanks,

venu.

Former Member
0 Kudos

Yigal,

Your requirement is not very clear. You have a different Message structure and a different Recordset structure. Which is the correct one? Or am I missing some thing here.. If possible give us a sample input file to get a better idea.

Regards,

Jai Shankar

Former Member
0 Kudos

Simply, the thing is that i don't know ahead what will be the values in the file rows so i can not use Key Fields in order to read it

Former Member
0 Kudos

Yigal,

This does not make much sense to me.

In your input file if all values are different, then how can <b>you</b> differentiate between a header, body and a trailer? There should be some value which uniquely identifies this. Check it again. That is the reason I asked for a sample input.

Hope you understand what I mean.

Regards,

Jai Shankar

Former Member
0 Kudos

Shankar,

The only thing i know about the file is that the first line i the Header and the last line is the Trailer.

In case i can not use the File Adapter to read and convert it to my message struture then i will close this thread.

Thanks,

Yigal.

Former Member
0 Kudos

Yigal,

Yes. Atleast try to make out some pattern in the file. If not you can not do this with sender file adapter.

Regards,

Jai Shankar

prabhu_s2
Active Contributor
0 Kudos

i believe with out a key field u will not be able to identify the header and trailer......lets look for others input also

Former Member
0 Kudos

you cantdo this without key field