如何在notepad++中用逗号作为分隔符连接多行

1 python notepad++

我需要将记事本++中的多行加入一行,以逗号作为分隔符

one
two
three
four
five
Run Code Online (Sandbox Code Playgroud)

我需要的输出如下

one,two,three,four,five
Run Code Online (Sandbox Code Playgroud)

Ctrl+ACtrl+j将加入但会增加空间

Tot*_*oto 5

  • Ctrl+H
  • 找什么: \R(?=\S)
  • 用。。。来代替: ,
  • Replace all

解释:

\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
Run Code Online (Sandbox Code Playgroud)

给定示例的结果:

one,two,three,four,five
Run Code Online (Sandbox Code Playgroud)