WhatMeWorry
2005.06.14, 04:36 PM
I've moved a whole lot of SimpleText files on OS 9.0 over to a new Tiger
system. The SimpleText files were used as input into a C++ program
via the cin ooperator.
My C++ program was aborting. Turned out that the SimpleText files where
now TextEdit files and they weren't the same formats. Found a "Make Plain Text" command in the TextEdit files. This almost works except the GDB debugger
now showed the file lines as being concated: line1\rline2\line3\rline4\r...<eof>
Went into vi comand at a Terminal and all the lines of the files were of course concatenated as well, but here it shows ^M at all occurrances of the Carriage
Return. I was able to manually delete the ^M and then insert a "return".
I saved of the files and my C++ program then worked fine.
The problem is that there are thousands of these \r (GDB) or ^M (vim) and I
don't know how to automate this process.
Can someone recommed an approach? I thought of grep, but how does one
differentiate between the control characters ^M (Carriage Return) and the
literal string "^M"
thanks in advance.
system. The SimpleText files were used as input into a C++ program
via the cin ooperator.
My C++ program was aborting. Turned out that the SimpleText files where
now TextEdit files and they weren't the same formats. Found a "Make Plain Text" command in the TextEdit files. This almost works except the GDB debugger
now showed the file lines as being concated: line1\rline2\line3\rline4\r...<eof>
Went into vi comand at a Terminal and all the lines of the files were of course concatenated as well, but here it shows ^M at all occurrances of the Carriage
Return. I was able to manually delete the ^M and then insert a "return".
I saved of the files and my C++ program then worked fine.
The problem is that there are thousands of these \r (GDB) or ^M (vim) and I
don't know how to automate this process.
Can someone recommed an approach? I thought of grep, but how does one
differentiate between the control characters ^M (Carriage Return) and the
literal string "^M"
thanks in advance.