将两行合并为一行 - Notepad++ [英] Merging two lines into one - Notepad++

查看:115
本文介绍了将两行合并为一行 - Notepad++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一条这样的线

assignee: Akebono Brake Industry Co. Ltd.  , 
 Fujitsu Limited  application_no: 06/946,825

我希望输出是

assignee: Akebono Brake Industry Co. Ltd.  , Fujitsu Limited  
application_no: 06/946,825

要将 application_no: 06/946,825 带到下一行,我可以找到 application_no: 并将其替换为 \napplication_no:我的记事本++

To bring the application_no: 06/946,825 to the next line, I can find application_no: and replace it with \napplication_no: in my NOTEPAD++

但是,如何将跨越下一行的字符串带回第一行?我的意思是我该怎么做才能让 Fujitsu Limited 加入以 assignee 开头的行:

But, how can I bring that string that spans to next line back to the first line? I mean what should I do to get the Fujitsu Limited to the line starting with assignee:

请问有什么指导吗?

推荐答案

由于 Extended 是唯一正确处理换行符的模式,但您需要与正则表达式匹配,因此您需要分两步完成.

Since Extended is the only mode that handles the newlines correctly but you need to match with regular expressions, you will need to do this in two steps.

首先,使用正则表达式查找和替换将一些可识别的标记添加到您想要向上移动的每一行的开头,我使用了匹配",但您绝对可以改变这一点.

First, use a regex find and replace to add some recognizable token to the beginning of each line you want to move up, I used 'MATCH' but you could definitely change this.

然后,切换到 Extended 以搜索后跟标记的换行符,并将其替换为空字符串以删除换行符和标记.

Then, switch to Extended to search for a newline followed by the token, and replace it with an empty string to delete both the line break and the token.

这篇关于将两行合并为一行 - Notepad++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆