I have a requirement to split the sample input file, given below.
A sample XML file:
AA1-AA001-3-V001.xml
<Upos>
<Upo><Deelnemer><b>---------------------------------------------------
-------------------------------------------------------
</UPOS>
AA1-AA002-4-V001.xml
<Upos>
<Upo><Deelnemer><b>---------------------------------------------------
-------------------------------------------------------
</UPOS>
---------------------------------------
----------------------------------
Now, a job needs to be written to split the above files into different different files (no. of files depends on the record present in the main input file) starting from the header part to the end of </UPOS>
In the above example there will be 2 files. First file will contain data:
AA1-AA001-3-V001.xml
<Upos>
<Upo><Deelnemer><b>---------------------------------------------------
-------------------------------------------------------
</UPOS>
And the 2nd file will contain data
AA1-AA002-4-V001.xml
<Upos>
<Upo><Deelnemer><b>---------------------------------------------------
-------------------------------------------------------
</UPOS>
Now the number of records in the main input file are variable and depending on that seperate files need to be generated.