Hi,
I'd like to ask for some help with the following:
I've cut a couple of columns of file1 to create file2 with the following code:
cur -f 1,3,8 file1 > file2
Then I need to transfer file 2 from UNIX to Windows and use it further.
Unfortunatelly, for some reason the line is displayed as two fields in one line and then the third one is in separate new line. Something like this:
filed1 filed3
filed8
filed1 filed3
filed8
etc
When I tried to look at the file in Unix the the code:
less-l file2
it write this:
filed1 filed3^M filed 8
I tried to get rid of the "^M" by the following code:
replace "^M" " " -- file2
But nothing happens.
Could anybody help me to get rid of it and have mine three fields in one line, please?
To check your original files to see whether that is where the carriage-return came from.
The carriage returns show as "\r" , the line feeds show as "$".
sed -n l original_filename
The text file line terminator in MSDOS is two characters "cr/lf", wheras on unix it is one character "lf". When transferring files to/from MSDOS systems it is important to know this and to either convert the file in transit (e.g. with text file FTP) or to convert the file on one of the servers.