问题
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+A and Ctrl+j will join but will add space
回答1:
CTRL+ H -> check "regular expression" -> search \s\r\n (or \s+ )-> replace all with ,.
Similar question on SuperUser.
回答2:
- 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 end of the string
Result for given example:
one,two,three,four,five
来源:https://stackoverflow.com/questions/42465806/how-to-join-multiple-lines-in-notepad-with-comma-as-a-separator