Skip to Content
author's profile photo Former Member
Former Member

Sorting the file in file content conversion.

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Dec 20, 2010 at 01:47 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 20, 2010 at 06:28 AM

    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,

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.