![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DOS/Windows CR to a UNIX LF 17 MB text file | tex | Windows & DOS: Issues & Discussions | 9 | 05-21-2008 09:31 PM |
| Opening a Unix File in Windows. | a439511 | UNIX for Dummies Questions & Answers | 6 | 03-07-2008 02:13 AM |
| How send a file from UNIX to Windows with FTP | edzela | Shell Programming and Scripting | 1 | 08-28-2006 06:20 AM |
| ftp file from Windows to Unix automatically | whatisthis | Shell Programming and Scripting | 4 | 11-14-2005 11:55 AM |
| FILE MANAGEMENT in WINDOWS & UNIX | farazcis | UNIX for Dummies Questions & Answers | 1 | 06-09-2005 08:27 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
windows file to unix :end line chararcter
hi ,
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. Thanx, |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
"dos2unix"
and "unix2dos" can be used to convert the files from dos to unix and vice versa using unix2dos You can get it from web for free Cheers JK |
|
#3
|
|||
|
|||
|
Re: windows file to unix :end line chararcter
Quote:
|
|
#4
|
|||
|
|||
|
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........ |
|
#5
|
|||
|
|||
|
Well there is one utility called flip (option -u to remove the ^M)
flip -u filename that will remove the ^M, but I don' t know whether this is supported by all. As for the dos2unix is concerned it will just put the output to the console, you can redirect it to some junk file or the same file. dos2unix filename > junk.txt mv junk.txt filename Cheers JK |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
||||
|
||||
|
Hi 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. Regs David |
||||
| Google The UNIX and Linux Forums |