Skip to content Skip to sidebar Skip to footer

How To Join Multiple Lines In Notepad++ With Comma As A Separator

I need to join multiple lines in notepad++ into one single line with comma as a separator one two three four five the output that I need is as below one,two,three,four,five Ctrl+

Solution 1:

  • Ctrl+H
  • Find what: \R(?=\S)
  • Replace with: ,
  • Replace all

Explanation:

\R     : any kind of linebreak
(?=\S) : Positive lookahead, make sure we have a non space character after, to avoid inserting a comma at the endof the string

Result for given example:

one,two,three,four,five

Solution 2:

CTRL+ H -> check "regular expression" -> search \s\r\n (or \s+ )-> replace all with ,.

Similar question on SuperUser.

Post a Comment for "How To Join Multiple Lines In Notepad++ With Comma As A Separator"