After opening the file in vi, try this.
:%s/\r//g

It replaces all the \r with nothing, thus effectively removing the ^M chars.

Windows uses CRLF for the new line character while linux uses just LF.

cheers

On Saturday 02 March 2002 06:38, you wrote:
> Hi,
>
> How do i convert DOS files to Unix files after porting from the Windows
> partition.
> I usually have to port my C code from Windows partition to Linux. Vi works
> fine, showing a [dos] in the end. But then when i use some programs like
> "indent" all new lines are replaced by ^M which i can neither find in vi
> using / nor use the grep command.
>
> BTW, which one has both CR and LF and which one has only CR as new line
> charachters?
>
> Converting back is simple by opening it in Wordpad and saving again.
>
> Any links to scripts/or hints on scripts wud be gr8.
>
> thanx ..
_______________________________________________
http://mm.ilug-bom.org.in/mailman/listinfo/linuxers

Reply via email to