基本上这是文本
data
data2
someotherdata
someotherdata2
我希望他们像这样合并
data:data2
someotherdata:someotherdata2
有什么办法可以使我工作? (在记事本++上)
答案 0 :(得分:1)
在“查找/替换”对话框中,确保“点匹配换行符”已关闭并且正则表达式模式已打开,然后将所有^(.+)\r?\n?(.+)\r?\n?
替换为$1:$2
。
答案 1 :(得分:0)
^.+\K\R
:
. matches newline
说明:
^ : beginning of line
.+ : 1 or more any character but newline
\K : forget all we have seen until this position
\R : any kind of linebreak (ie. \r, \n, \r\n)
给定示例的结果
data:data2
someotherdata:someotherdata2