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!

remove carriage returns from text file?

Status
Not open for further replies.

ryan010101

Technical User
Jan 24, 2001
83
US
Hello,
I need to create a script that will strip out all the carriage returns from a text file. The text in the file I'm being sent is supposed to all be on one line with no breaks, but the other person's software is inserting CRs supposedly when it is FTPed. Any help would be appriciated.

thanks
Ryan
 
Try something like this:
tr -d '\015' </path/to/input >output

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
That kinda worked except the breaks are still there (the file is a few bytes smaller). I guess I should've said I need to remove carriage return/line feeds?

Thanks for the reply.
 
I found it (\015\012) and it works. Thanks for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top