1
I use Cygwin and made a txt file using a Perl script.
There is a ^M (Windows cariage return) added, and I have no idea how.
How do I find ^M when normal ways (^m dos2unix and sed or "grep -r $'\r' *") does not work?
when using less file01 I can see the ^M, but I am unable to match it with anything (not with \r nor with ^V^M).
When using Col (see man col) I get rid of it and several other things (I get a very, very strange output)
normal output:
JAN131005 GO:0009055 // GO:0020037 // GO:0003723 // GO:0006468 // GO:0016023 // GO:0003676 // GO:0003964 // GO:0005515 // GO:0004672 // GO:0000166 // GO:0004497 // GO:0006278 // GO:0009055 // GO:0020037 // GO:0003723 // GO:0006468 // GO:0016023 // GO:0003676 // GO:0003964 // GO:0005515 // GO:0004672 // GO:0000166 // GO:0004497 // GO:0006278 ^M // GO:0009055 // GO:0020037 // GO:0003723 // GO:0006468 // GO:0016023 // GO:0003676 // GO:0003964 // GO:0005515 // GO:0004672 // GO:0000166 // GO:0004497 // GO:0006278 ^M // GO:0003964 // GO:0003723 // GO:0006278 // GO:0005488 // GO:0003676 ^M // GO:0005622 // GO:0000166 // GO:0005886 // GO:0006950 // GO:0009628 // GO:0009719 // GO:0005515 // GO:0006950 // GO:0005515 // GO:0006950 // GO:0003674 // GO:0008150 // GO:0003676 ^M // GO:0003676 ^M // GO:0003964 // GO:0003723 // GO:0006278 // GO:0005488 // GO:0003676
after "col < file01 > test01" less test01 gives:
J//1GO:0003964 //OGO:0003723///OGO:0006278///OGO:0005488///OGO:0003676///OGO:0009719///OGO:0005515///OGO:0006950///OGO:0005515///OGO:0006950///OGO:0003674///OGO:0008150///OGO:0003676// GO:0009055 // GO:0020037 // GO:0003723 // GO:0006468 // GO:0016023 // GO:0003676 // GO:0003964 // GO:0005515 // GO:0004672 // GO:0000166 // GO:0004497 // GO:0006278
as you can see I have removed the problem, and replaced it with 2 others... Can anyone explain what col is removing here and how, as well as how I should remove it to just remove the ^M?
The Windows carriage return is \r\n. Are you trying to remove it or convert it to a Linux \n? – Dane – 2013-07-18T16:20:18.167