I have temp.xml file with below contents,
<records>
<profile/>
<profile/>
<profile/>
<profile/>
.
.
</records>
I will pass the number of records,'n', as the input. I want the temp.xml file to be split into 'n' number of records. For eg., if I have 4 records in temp.xml and if I pass n value as 2, then 2 files has to be created with 2 records each.
The output file name can be anything. For eg., below is the sample output. where 4 records are split into 2 files with 2 records (profile). Records count should be consistent.
temp1.xml
<profile/>
<profile/>
temp2.xml
<profile/>
<profile/>
RS='<profile'& based on n passed & NR value, change the output file name.