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.
File:
-
File (Show All Characters):
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.
Replace #1 (
\n
with(blank)
):File after Replace #1:
Replace #2 (
\r
with\r\n
):File after Replace #2:
Final result:
Conclusion: Notepad++ seems to be able to do the job just fine!
Solution 2:
In the Notepad++ menubar click Edit → EOL Conversion → Old Mac format to format for entire files.
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.