Text file with ^M on each line

后端 未结 3 1282
萌比男神i
萌比男神i 2020-12-28 22:11

I just got a source code file from a friend. The file was created in UNIX. When I opened it in Windows using NotePad++, each line had one extra blank line.

Puzzled,

3条回答
  •  不知归路
    2020-12-28 22:19

    It is a carriage return. DOS/Windows editors tend to use a carriage return and a line feed, Unix editors like to use just the line feed. Some editors like geany and textpad can detect it and dont show you the ^M, and some will let you do a save as where the choices include unix style or crlf style. There is also the issue of having an EOF at the end of the file that some compilers used to require.

提交回复
热议问题