Carriage return in notepad ++, but not a text panel?

I have some text files copied to a server. I usually use notepad ++ and prefer to view text files, but only a text panel is installed on this server. This is really weird behavior, but I noticed that when I look at EOL characters in notepad ++, I can clearly see and look for CRLF (i.e. \ r \ n). But when I display the same files in the text panel, I can only search on LF (\ n) and cannot see matches on CR (\ r). Am I missing something due to the way Textpad interprets EOL characters?

+7
source share
3 answers

This occurs when the EOL control characters are incorrect. Windows represents carriage return + line feed characters.

In Notepad ++, you can verify these characters by selecting:

View> Show characters> [x] Show end of line

notepad ++

You need to modify your script so that your data is formatted as follows:

CRLF

+20
source

Yes, ideally, a carriage return and the next line,

\ r \ n

but you can also use short shorthand to place {lf} and then {cr} {lf}

\ P

+2
source

I know this is a little old question, but I was struggling with this exact problem, and here is how I found a workaround.

When using Save As in the text panel, you can specify the file format at the bottom ( PC , UNIX or Mac ). If you choose UNIX in theory, this ends the lines with only the \n character, however you must change this parameter each time.

You can change the settings for certain "document classes" to specify the format of the output file. Follow these steps:

  • Click Configure
  • Go to Preferences
  • Expand the Document Classes List
  • Choose bash , which should include *.sh files
  • Scroll down until you see Create new files as
  • Choose UNIX

Now you should save all *.sh files that you create in UNIX format without carriage return. Good luck.

I found this information here: http://homes.ori.org/~keiths/Files/Tips/Software_TextPad_Prefs.html#DocClasses

0
source

All Articles