Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Split large XML file to smaller files

I have an xml file which is BIG. Now I want to use Talend to split the file into x files having the same structure as the original file. For example, the orignal file contains 6 books. I want a job which creates two files, each having three books, but the structure should stay the same: sow the leading header line and the surrounding <books> tag should be in both splitted output files. For some reason I can't manage to do this within talend. Why not? I DON'T want to to configure some kind of component and build up the complete output xml myself... I just want to iterate through /books/book and save them in multiple output xml files. Why is this so hard within Talend?
<?xml version="1.0" encoding="utf-8" ?>
<books>
<book>
<code></code>
<text></text>
</book>
<book>
<code></code>
<text></text>
</book>
<book>
<code></code>
<text></text>
</book>
<book>
<code></code>
<text></text>
</book>
<book>
<code></code>
<text></text>
</book>
<book>
<code></code>
<text></text>
</book>
</books>
Labels (3)
2 Replies
Anonymous
Not applicable
Author

Why is this so hard within Talend ?
it's not !
You should create your metadata XML for input and output.
then
you create a job, with a tFileInputXML and a tAvancedFileOutputXML by drag & drop metadata on designer view.
you link the 2 components together by a main link, schema sould be the same, check only java type.you can use a tConvertType too
and last step :
in the advanced setting of the tAvancedFileOutputXML you check split output and set number of rows by file
Anonymous
Not applicable
Author

But can I simple loop through the booms and without specifying the contents within a book, copy all the books?