In Notepadd++ the \\r\\n
regex will find all the CRLF
combinations. But I have some lines which end just with LF
s. First of all, what
Set the encoding to ANSI.
Then \n will see only "LF"
Using common sense I would suggest following approach:
And you are done.
LF stands for 'Line Feed'
You can read some more on this answer on serverfault.se:
CR LF means "Carriage Return, Line Feed" - it's a DOS hangover from the olden days from when some devices required a Carriage Return, and some devices required a Line Feed to get a new line, so Microsoft decided to just make a new-line have both characters, so that they would output correctly on all devices.
Windows programs expect their newline format in CRLF (
\r\n
). *nix expect just LF data (\n
). If you open a Unix text document in Notepad on windows, you'll notice that all of the line breaks dissapear and the entire document is on one line. That's because Notepad expects CRLF data, and the Unix document doesn't have the\r
character.There are applications that will convert this for you on a standard *nix distro (dos2unix and unix2dos)
For those wondering, a carriage return and a line feed differ from back in Typewriter days, when a carriage return and a line feed were two different things. One would take you to the beginning of the line (Carriage Return) and a one would move you one row lower, but in the same horizontal location (Line Feed)
Thus, you should be able to replace it with \n
.