[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: CR characters in d/l'ed text files



tr -d '\015' < pc.file

should do the trick. Be careful not to redirect that ouput back onto
your input file, though, you have to put that to a temp file first.
(if you tried to do > pc.file the file would be clobbered when the
output stream opened it for writing).

While we're on the subject, and in case it ever comes up, a mac file
can be converted with

tr '\015' '\012' < mac.file

You can do all your CR/LF translations with tr as long as you can
remember that macs use CRs, *nices use LFs, and winDOS uses CRLF.

Vineet

* Kevin Stokes (linux@pieskysoft.com) [010623 11:28]:
>    I have a very simple newbie question.
> 
>   I have downloaded a bunch of .java source code, but when I edit it with
> VI, there is a carriage return at the end of each line.   What is the
> standard Linux way of filtering those out?
> 
>   Thanks very much for your time.
> 
> Kevin Stokes
> Pie in the Sky Software
> www.pieskysoft.com
> 
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 

Attachment: pgpAxi2Sw4eNs.pgp
Description: PGP signature


Reply to: