Notepad ignoring linebreaks

There are line-breaks, however different operating systems recognise different sequences for line-breaks.

Notepad only recognises CR, LF (0x0d, 0x0a), whereas other sources might use CR only, or LF only.

You can't make Notepad behave differently, so your only option is to make sure the content has the right sequence for Notepad. Note that notepad is the only editor with this restriction, so if your content works in Notepad, it will work everywhere else.

One simple way to fix the line-feeds is to copy and paste the text into Word, then back again into notepad, and the line-feeds will get "corrected" to the CR,LF sequence.


Wordpad

If your aversion to notepad++ and other text editors is that they are not a standard part of all Windows systems, use Wordpad. It's not quite as rudimentary as Notepad.

Wordpad will correctly read and display text files with with Unix line-endings.

Other

If you are averse to both the one-true text editors then notepad++ is probably a good choice.


You could write a simple batch script:

@ECHO OFF
TYPE %1 | FIND /V "" >%1.1
MOVE %1.1 %1 > NUL 2>&1
START "NOTEPAD" C:\WINDOWS\SYSTEM32\NOTEPAD.EXE %1
EXIT /B

Save this as notepad.bat in whatever directory you like. Then, instead of opening your .info/.css/.js files with Notepad, open them with this batch script. It will automatically convert all Unix line endings to DOS and then open the file with Notepad.

Drawbacks:

  • Every time you open the program it appends a newline to the end of the file. (Fixed by @mpag)
  • Opens a Command Prompt window (Fixed using START on line 4)
  • Changes the file's creation date to the current date