Skip to Content

XML file split based on number of records

Hi,

I have a requirement as follows,

PI needs to pick up xml file from source directory and split file for every 10K records and generate a xml files then place it in target directory.

I have gone through some forums but did not help me,can you please provide me some inputs on the same.

Please also let me if there is a way to split xml file based on size and place xml files in the target directory.

Cheers,

Giri

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Aug 23, 2016 at 07:41 AM

    Try with multi-mapping and an udf to split records after 10k records it should work.

    and also splitting on size is possible but it wont work in your case as this is xml file and will result in invalid xml by splitting based on filesize.

    br,

    Manoj

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 23, 2016 at 08:11 AM

    Hello Venkat.

    You can try the split approach mentioned by Venkat using the UDF in the below link

    Split Mapping using UDF - Process Integration - SCN Wiki

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 23, 2016 at 09:25 AM

    Hi Venkatagiri!

    If your source structure isn't much complicated you could use approach with pure graphical mapping described in this thread:

    As other option I would consider using java mapping with SAX parsing as it works faster than DOM and consumes less of resources.

    Regards, Evgeniy.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 23, 2016 at 11:01 AM

    Hi Giri,

    Where do you want to write the files after split? to NFS or FTP or SFTP location.

    Regards

    Anupam

    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.