The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-23-2008
dasj22 dasj22 is offline
Registered User
  
 

Join Date: May 2008
Posts: 3
Lightbulb Padding Carriage return to the end of XML file

Hi All,
I am getting a xml file where the first field contains a carriage return and the all other fields doesnot contains any carriage return. So all the other records comes in the second line.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:iSeriesCspIntegration xmlns:ns0="http://www.ABC.com/xmlschema/cspintegration/"><header><flow>ACTRSP</flow><sender name="PQR"></sender><receiver name="CspHost"></receiver><generationDate>20080522-133152</generationDate>


So, basically i want to put a carriage return at the end of each closeing tag.
like this:

<?xml version="1.0" encoding="UTF-8"?> ["carriage return" ]
<ns0:iSeriesCspIntegration xmlns:ns0="http://www.ABC.com/xmlschema/cspintegration/"> ["carriage return" ]
<header> ["carriage return" ]
<flow>ACTRSP</flow> ["carriage return" ]
<sender name="PQR"></sender> ["carriage return" ]

can this be done in unix script.
please let me know the code that need to written for this.