When i ftp a text file from Windows to unix enviornment and open the file in " vi editor" the end line charcrter of the windows file is seen as "cntrl\+M" charcter in the Unix enviornment.
Is there any command in unix , so that i dont see this "cntrl+M"
chararcter in the Unix vi editor.
hi,
in the Vi editor it still shows me the cntrl+M characters for the end- line ,
after using the dos2unix command ....
Is there any command by which the cntrl+M in vi editor can be made invisible........
hi jaya,
My unix is solaris 5.8 , it doesnt support " flip " caoomand i guess . But its fine when i trasfer the file in
"ASCII" mode i get the file w/o cntrl+M characters ...
So the problem is solved...
Cheers,
Dharmesh
Still if you will ever find a file that contains the CTRL + m characters there is a very easy way to get rid of them. They have been mention many times here on the forums.
The way to do this is to open the file using vi. Stay in Escape mode and type the following :
:1,$s/<CTRL>+v <CTRL>+m//g
<ctrl>+v says that the next character is a special character. This will be substituted with nothing. i.o.w. removed
:1,$ just says from line number 1 until the end.
I seem to have a problem not mentioned here. The version of (x)emacs that I use most often doesn't seem to insert any line breaks at each ^M, so when I use dos2unix I lose the line breaks altogether in all text editors (e.g. newer versions of (x)emacs and in Windows). Does anyone have any ideas how to get around this ?
I don't use dos2unix at all. Just ftp the file to unix and then ed filename. In the status line you will see an indicator that this is a DOS file (i.e. has CRLF as end of line instead of UNIX's LF). If necessary, you can then use 'C-x RET f big5-unix' to change the coding to UNIX.