Notepad ++-如何查找不以字符串开头的行并将其合并到上一行?

时间:2019-07-08 12:30:43

标签: notepad++

我想搜索所有不以'OPM'开头的行,然后将这些行合并到上一行

我有这段文字:

OPM1352 - a
b 
c 
OPM9574 - d 
OPM5841 - e 

我想要输出:

OPM1352 - abc 
OPM9574 - d 
OPM5841 - e 

1 个答案:

答案 0 :(得分:3)

"FeaturedImage": {"ID": 13, "Link": "sample/link/address"} "Categories": [ {"ID": 1, "Link": "sample/link/address", "Title": "SampleTitle"} ], + Ctrl(替代搜索->替换...),然后选择H。启用regular expressions。然后Wrap around

Find what

[\r\n](?!OPM) :为空

然后全部替换。