Skip to Content
0
Former Member
Jul 04, 2007 at 05:10 AM

Sort records before processing

146 Views

Hi SDNers,

My requirement is File - XI - R/3 (IDOC). Before processing the file, it should be sorted out based on a particular field.

Eg. The input file may have this pattern. I need to sort the file based on second field.

D,5601,Jai,Caritor

D,5000,Raj,Caritor

D,7000,Albert,Caritor

Records after sorting

D,5000,Raj,Caritor

D,5601,Jai,Caritor

D,7000,Albert,Caritor

I tried the following way. Read the whole record as a node, so there are 3 nodes for the above example. With in adapter module, retrieve all records and based on the second field sort and then construct the XML with each record containing all 4 fields. I am using DOM parser for this.

Issue: My actual input file has 27 fields and the size of the file is expected around 2 to 20 MB. It is really diffucult to construct the output XML. Is there any other alternative or a better way to handle such scenario?

Share your ideas.

Thank You.

Regards,

Jai Shankar