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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing white space at the end of each record in a file.

Status
Not open for further replies.

jayjaybigs

IS-IT--Management
Jan 12, 2005
191
CA
Hello,

I am trying to remove all the white spaces at the end of each record.
I used sed -e 's/, /,/g' original.txt > space_removed.txt
but this only remove spaces b4 comma. How can I modify this to remove space only at the end of each record.

Tks
 
sed 's! *$!!' original.txt > space_removed.txt

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top