Replace Carriage Return and Line Feed in Notepad++

I have a file with a mix of CRLF and LF, and wish to remove the LF. I am new to Notepad++ and just downloaded V6.23.

I'm using the search/replace dialogue box in extended mode. It will find and count the CR LF (using \r\n) but if I do a replace (to e.g. a blank or \r) nothing happens, and a replace all says it has replaced 0 occurrences. There are around 1000 CRLF in file and may be 100 lone LF.

Any ideas?


Solution 1:

Task: File has a mix of CRLF and LF, and you want to end up with only CRLF and delete all standalone instances of LF.

  1. File:
    1

  2. File (Show All Characters):
    2

    Now if you delete only the standalone LF at the end of Line 3, you should end up with Lines 3 and 4 joined together, with the rest of the line endings unaffected.

  3. Replace #1 (\n with (blank)):
    3

  4. File after Replace #1:
    4

  5. Replace #2 (\r with \r\n):
    5

  6. File after Replace #2:
    6

  7. Final result:
    7

Conclusion: Notepad++ seems to be able to do the job just fine!

Solution 2:

In the Notepad++ menubar click EditEOL ConversionOld Mac format to format for entire files.

Image of How to Do this.

Solution 3:

Here's a SUPER SIMPLE WAY....

Select all the text you want to change, and then Click Edit Menu --> Line Operations --> Join Lines.

-Or-

Simply, press CONTROL + A, and then CONTROL + J to do the same.