Results 1 to 5 of 5
Hi all,
I have problem with text file formats.
When my files are saved by Windows programs like Winword or other code editor like Visual Studio , they are added ...
- 05-06-2005 #1Just Joined!
- Join Date
- Nov 2004
- Posts
- 47
How can I get right text format?
Hi all,
I have problem with text file formats.
When my files are saved by Windows programs like Winword or other code editor like Visual Studio , they are added some code for each line which display as ^M when opening by mc program in Linux (I am sorry, I just have very few idea about file format, so I don't know how to call it but to describe the phenomenon only
).
Along time ago, I have ever used a code editor in which I can choose the file format to save so that no ^M display in mc. Now I can't recall what that program and what save option were.
Could someone tell me what text editor I can use to change my file (with ^M showed in mc) into the wanted format (no ^M showed in mc) and which save option I have to use to save the file?
Thanks a lot.
- 05-06-2005 #2
Windows uses <cr><lf> for linebreak
Old Macs use <cr> for linebreak.
In UNIX <lf> character is used.
So ^M is <cr> character
To see no "^M" you'll have to use editors with Windows-type linebreak, such as kedit
- 05-06-2005 #3Linux Newbie
- Join Date
- Apr 2005
- Location
- Charlottesville, VA
- Posts
- 175
If indeed that is the problem, you could also try using unix2dos and dos2unix to convert between the two types.
---sxeraverx---
Linux without a C Compiler is like eating Spaghetti with your mouth sewn shut. It just doesn't make sense.
- 05-08-2005 #4
By the way GNU nano has options --dos and --mac which let you to use <cr><lf> or <cr> instead of <lf> character for linebreak
- 05-10-2005 #5Just Joined!
- Join Date
- Nov 2004
- Posts
- 47
Thanks for your help.
dos2unix works for me. Also thanks for explanation about the CR and LF line terminators, it remind me about the day I wrote my first programs on PC, I already met the line terminators ascii number 10 and 13. How can I forget them all :o


Reply With Quote