[Techtalk] get rid of "^M" in a file

Hugo Chasqueira hchasqueira at netcabo.pt
Fri Jun 17 23:07:00 EST 2005


On Thursday 16 June 2005 01:03, Noir wrote:
> I have a file (.vimrc) which was in Windoze and now at
> the end of each line of the file I have a "^M" which
> is (obviously) generating lots of errors while
> executing vim.
>
> I want to get rid of all the "^M". I can hand-hack it
> but that sound inefficient. I wanted to use "flip -u"
> but the OS I am currently in doesn't have that.
>
> Is there anything else I can use to get rid of that?

Simply open the file with vi and type the following commands:

:set ff=unix
:wq

It's done. You can do the reverse with:

:set ff=dos
:wq


-- 

Hugo Chasqueira

Public Key:
http://www.fcee.ucp.pt/docentes/url/hbc/pubkey.txt



More information about the Techtalk mailing list