Thursday, January 1, 2015

Split large XML into multiple XML

In this post, I will describe you how to split large XML into several xml.

Here is our Sample XML file. ( which is not huge but just a sample)

Split Xml Talend

We are expecting three XML files from sample xml hence lets start with metadata creation for this sample file.

Once you created metadata then you can drag and drop schema to job designer. for the scenario we will choose tFileInputXML component.

Now add another component tXMLMap and link tFileInputXML to tAdvancedFileOutputXml then configure tAdvancedFileOutputXml as shown in image.

tAdvanceOutputXMl Mapping

Now we have mapped our source column to output columns, but it will output all the rows in single file, to create a file for each row we have to configured tAdvancedFileOutputXML component using Advance property of component tab. use "Spit output in Several files" option with value as "1". by doing this it will create new file for each row.

tAdvancedOutputXML Setting

After run, this job will create three files on mention path like below.

Output Xml Files

And here is the final output.

Output Xml Files splitxml6 splitxml7

No comments:

Post a Comment

Contact Us

Name

Email *

Message *