"Inconsistent line ending style" nightmare

In Notepad++, select menu ViewShow SymbolShow End of Line.

In the search box (Ctrl + F), select the Regular Expression search mode and search for the string:

[^\r]\n$

(translation: \n without a \r before it).

This will bring you directly the problem line(s) where you'll see the line ending with LF rather than with the pair CR-LF.


You can capture the w, (\w)\n$, and replace it with $1\r\n where $1 is the character.

Searching and replacing with NetBeans with this regex does the job.

My problem was that a custom script inserted wrong EOL characters (\n instead of \r\n) in these files).

(I answered my own question with @assylias's comment.)


Under Windows 7, you can use Notepad++ v5.6.8 to convert EOL characters:

Menu EditEOL ConversionWindows / Unix / Mac