The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Replacing the last data of each line ina file jisha Shell Programming and Scripting 6 4 Weeks Ago 04:47 AM
Replacing a line in a file - HELP!!! maxmave Shell Programming and Scripting 1 06-04-2008 08:55 PM
replacing a line of unknown charecters in a file malavm Shell Programming and Scripting 12 07-26-2007 01:25 AM
replacing first line or lines in a file Terrible UNIX for Advanced & Expert Users 3 06-28-2006 05:23 PM
replacing the character "\" in a file rjsha1 Shell Programming and Scripting 5 01-11-2006 05:45 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-17-2008
Registered User
 

Join Date: May 2008
Posts: 18
Question Replacing end of line with " in a UNIX file

How should I replace End of line Character by ".
i.e in a file -
Name1,NO1
Name2,No2
Name3,No3
....

Should look like --
Name1,NO1"
Name2,No2"
Name3,No3"
....
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-17-2008
Part Time Moderator and Full Time Dad
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 758
Code:
sed -e 's/$/"/' filename > newfile
Reply With Quote
  #3 (permalink)  
Old 05-17-2008
Registered User
 

Join Date: May 2008
Posts: 18
Thanks Yogesh. It worked fine.
Reply With Quote
Google UNIX.COM
Reply

Tags
sed

Thread Tools
Display Modes




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


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

Content Relevant URLs by vBSEO 3.2.0