Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Character replace 2

Status
Not open for further replies.

crasho2001

Technical User
Jun 13, 2002
51
TR
If the line ends with ,\n , it should be replace to ,.
If the line ends with \n, no change should be done.
How can I do?
 
Thank you for response. But I have problem. I am using Solaris.

e10>awk '{ORS=/,$/?"":"\n"}1' bulk2
awk: syntax error near line 1
awk: illegal statement near line 1
awk: syntax error near line 1
awk: bailing out near line 1
e10>
e10>
e10>sed -r ':b;/,$/{N;bb;};s/\n//g' bulk2
sed: illegal option -- r
e10>
 
crasho:

While on Solaris, try using nawk instead of awk.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top