[Dclug] annoying Ctrl-M characters

Omari Norman omari at smileystation.com
Thu Jul 5 18:59:55 EDT 2007


On Sun, Jul 01, 2007 at 12:02:53AM -0400, James Ewing Cottrell 3rd wrote:
> Ed T. Toton III wrote:
> >Within vi, I've often used a regex to remove the carriage returns when 
> >the file originated from a windows/DOS environment. ^M is just a 
> >carriage return character (since DOS/Win uses a CR/LF combo to 
> >terminate lines instead of just the linefeed).
> >
> >        :1,$s/\r$//
> 99% credit. :%s/\r$//

Actually, 1,$s and % are synonymous; in vim, try :help range

-- 
Stronger than an Altoid.



More information about the Dclug mailing list