[Notepad++] Remove CR Carriage Return and LF Line feed (CRLF)


Posted on : Fri, 18th Sep 15 12:26 pm UTC
2314 votes

Lets see how we can find and replace CR (Carriage Return) and LF (Line Feed) characters from a file using Notepad++ application on Windows operating system.

First lets see what there characters are,

How to find CRLF characters using Notepad++

You can use regular expression to find CRLF character,

  1. Open file in Notepad++
  2. Goto Find,
  3. Make sure that in Search Mode, Regular Expression option is selected.
  4. In "Find what" add regular expression [\r\n]+
  5. Now you should see CRLF characters highlighted.

How to find and replace CRLF using Notepad++

You can use regular expression to find CRLF character,

  1. Open file in Notepad++
  2. Goto Find & Replace ,
  3. Make sure that in Search Mode, Regular Expression option is selected.
  4. In "Find what" add regular expression [\r\n]+ and in Replace with : \n
  5. CRLF will be replaced with newline character.

Note : There is a easier way available in the later versions of Notepad++

  1. Go to Edit -> EOL Conversion
  2. Select Windows Format

Code2care's mission is to share varied knowledge in technical and non-technical areas gathered during day-to-day learnings and development activities so that our visitors can leverage this portal to find solutions to their queries without re-inventing the wheel. Technical posts include Learnings, Tutorials, Video Tutorials, Code Snippets, Tips-n-tricks.

Follow us : Facebook - Twitter - Google +