cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting the file in file content conversion.

Former Member
0 Kudos
261

Hi all,

we have a file(xml)-pi-file(flat file) scenario,

where we need to sort the output file by employee id field.

Where can we achieve the sorting of file by particular field.

Do we have any option in Mapping(Functions) ??

Any option is Reciever File Adapter??

Reciever File content conversion??

Any inputs will be of gr8 help.

Regards.

santosh.

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

Where can we achieve the sorting of file by particular field.

Do we have any option in Mapping(Functions) ??

Yes, there is a function in message mapping called sort and sortByKey, these can be found under node functions. To sort the ID, you can use this code


ID --> removeContext --> sort:(ascending or descending) --> ID

Use sortByKey to sort the additional details of the flatfile according to ID number e.g.


ID --> removeContext --> sortByKey:(ascending or descending) --> IDDetails
Details --> removeContext --> /

Any option is Reciever File Adapter??

Reciever File content conversion??

The receiver file adapter with FCC only converts the structure that is defined in your target message type into, say for example a text file. You have to do the manipulations in the message mapping.

Hope this helps,

Mark

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Santhosh,

This can be done through message mapping. Use Sort / Sortbykey functions to achieve the requirement.

Try the mapping logic posted by previous post.

Thanks,

Former Member
0 Kudos

thanks guys......this helped a lot...