clears.in Menu

Remove line breaks in Notepad++

Open Search > Replace, choose Extended, find \r\n and replace it with a space.

What are the steps?

  1. Open Search > Replace, or press Ctrl+H source.
  2. Under Search Mode, choose Extended source.
  3. In Find what, type \r\n, a Windows line end source.
  4. In Replace with, type one space.
  5. Choose Replace All source.

On three lines:

Before

Line oneCR LF
Line twoCR LF
Line three

After

Line one Line two Line three

How do I keep the paragraphs?

Three passes, with a mark not in your file, such as @@:

  1. Find \r\n\r\n, replace with @@:

    Before

    Dear Asha,CR LF
    thanks.CR LF
    CR LF
    See you.

    After

    Dear Asha,CR LF
    thanks.@@See you.

  2. Find \r\n, replace with a space:

    Before

    Dear Asha,CR LF
    thanks.@@See you.

    After

    Dear Asha, thanks.@@See you.

  3. Find @@, replace with \r\n\r\n:

    Before

    Dear Asha, thanks.@@See you.

    After

    Dear Asha, thanks.CR LF
    CR LF
    See you.

Why not one pass?

An empty line between paragraphs is two line ends in a row, so replacing every \r\n leaves two spaces where the gap was:

Before

Dear Asha,CR LF
thanks.CR LF
CR LF
See you.

After

Dear Asha, thanks. See you.

What else should I know?

Windows or Mac line endings?

A file made on Windows ends each line with a carriage return and a line feed, \r\n; macOS uses the line feed, \n, alone source. If \r\n finds nothing, try \n.

Can a regular expression do it?

Yes. In Regular expression mode, \R finds any line ending source: find \R and replace with a space, whichever ending the file uses.

Text not in a file?

Paste it into Remove line breaks, which keeps paragraphs without any passes.