The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Issue with Removing Carriage Return (^M) in delimited file sirahc UNIX for Advanced & Expert Users 7 03-25-2008 02:08 AM
add carriage return at end of file HAA Shell Programming and Scripting 2 11-20-2007 08:58 AM
Carriage Return at end of file bd_joy Shell Programming and Scripting 14 10-20-2006 10:20 AM
Removing Carriage Return and or line feed from a file tbone231 Shell Programming and Scripting 1 02-18-2005 01:37 PM
Removing carriage return characters from file b1saini UNIX for Dummies Questions & Answers 3 09-10-2003 06:41 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-23-2008
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.
Reply With Quote
Forum Sponsor
  #2  
Old 05-23-2008
Registered User
 

Join Date: Mar 2008
Location: /bin/sh
Posts: 352
Do you mean "line-feed"or "carriage-return"?

this will append a newline...

Code:
echo >>file
Does this solve the problem..?
Reply With Quote
  #3  
Old 05-23-2008
Registered User
 

Join Date: May 2008
Posts: 3
reply

NO it does not solve my problem..
I have already tried with this..
Reply With Quote
  #4  
Old 05-23-2008
Registered User
 

Join Date: May 2008
Posts: 3
dasj22

I want a carriage return,,
not a line feed.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 02:03 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0