To read a flat file containing XML data

I have a file something like this:aaaa.xml content of the file is

0,<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<storeInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
<s> 
<BRANCH_NO>3061</BRANCH_NO> 
<BRANCH_NAME>GREEN EXPRESS</BRANCH_NAME> 
<STORE_TYPE>Superstore</STORE_TYPE> 
</s> 
</storeInformation>,<?xml version="1.0" encoding="UTF-8" standalone="yes"?><storeInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <s><BRANCH_NO>3061</BRANCH_NO><BRANCH_NAME>GREEN EXPRESS</BRANCH_NAME>NE><STORE_TYPE>Superstore</STORE_TYPE></s></storeInformation> 
1,<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<storeInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
<s> 
<BRANCH_NO>3062</BRANCH_NO> 
<BRANCH_NAME>GREEN EXPRESS</BRANCH_NAME> 
<STORE_TYPE>Superstore</STORE_TYPE> 
</s> 
</storeInformation>,<?xml version="1.0" encoding="UTF-8" standalone="yes"?><storeInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <s><BRANCH_NO>3062</BRANCH_NO><BRANCH_NAME>GREEN EXPRESS</BRANCH_NAME><STORE_TYPE>Superstore</STORE_TYPE></s></storeInformation> 

My requirement is i need to read the file line by line and write to two files

Output:
The first file should have this content

file1.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<storeInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
<s> 
<BRANCH_NO>3061</BRANCH_NO> 
<BRANCH_NAME>GREEN EXPRESS</BRANCH_NAME> 
<STORE_TYPE>Superstore</STORE_TYPE> 
</s> 
</storeInformation>

The second file should have this content file2.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><storeInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <s><BRANCH_NO>3061</BRANCH_NO><BRANCH_NAME>GREEN EXPRESS</BRANCH_NAME><STORE_TYPE>Superstore</STORE_TYPE></s></storeInformation> 

file1 and file2 will be processed .After processing, I need to read the second line of aaaa.xml and write it in the same file1.xml and file2.xml

In the same way i need to process the entire file line by line.

Could you please help me in resolving this issue?

Thanks
Krishnakanth Manivannan

Read this xml to csv and xml to data first. Include basic methods to convert xml into more flat version.

"Print version".

Sorry Sir.. I am getting junk characters from this link.

is it due to browser error?

krishnakanth

????

We have gone through the link. it is not helpful for us.

I am not sure whether the commands mentioned in the link are unix commands.

We have to perform this using Unix commands(shell script).

could you please help me on that!!

Krishnakanth Manivannan