[Techtalk] get rid of "^M" in a file
Gebhard Dettmar
gebhard.dettmar at student.hu-berlin.de
Sat Jun 18 00:37:26 EST 2005
On Friday 17 June 2005 00:50, jett charnchoochai wrote:
> tr command on linux would do the job.
>
> [jett at norbert]$ tr '\r' '\n' < macfile.txt > unixfile.txt
Thanks, this is probably quicker than perl -pi -e 's/\r\n/\n/' (my other
suggestion, which up to now didn't appear on this list). But my problem
was: if I don't see them I don't bother about them (should I make this a
new thread?) The pitfall is then, and that's why I asked if the OP sees
them in vim - he has troubles with vim, checks his vimrc, sees no ^M -->
thinks "there's nothing wrong in here". But obviously he does see them -
either he has a setting like 'set ff=I_don't_know' or he used less -u
> -jett
>
> > BTW, I can't think of problems caused by carriage returns in vim,
I just checked it with ff=dos in my vimrc. strange reaction: after
'vim file' it's running fast through the screen (for two seconds) then it
opens ;-)
Regards Gebhard
More information about the Techtalk
mailing list