may.y
may.y

Reputation: 173

How to remove linebreaks and replace them with a comma in Notepad++

I need some help in Notepad++ and regular expressions.

Example how it looks at the moment:

aaaaa
bbbb
cccccc

How I want it (remove breakpoints and replace them with a comma and a blank space):

aaaaa, bbbb, cccccc

I was told that I can do it by checking "Regular expression" and "matches newline" and;

Find what: "[\r\n]+"

Replace with:","

-> Replace All

However I can't find the "matches newline" in my Replace window. Do I need any plugins for it? The version of my Notepad++ is 5.7 (UNICODE).

Upvotes: 17

Views: 65653

Answers (2)

niksvp
niksvp

Reputation: 5563

Not much complications are required for removing linebreaks using notepad++

Just select from end of line to the start of next line and press CTRL + H, you will get the text to replace and then replace it with , or your desired character

Upvotes: 7

Michael Rodrigues
Michael Rodrigues

Reputation: 5137

Use the Extended search mode, replacing \r\n with ,

ScreenShot

Upvotes: 37

Related Questions