Notepad ++:删除包含“正确”一词的行及其上方的两行答案

您所在的位置:网站首页 notepad替换tab Notepad ++:删除包含“正确”一词的行及其上方的两行答案

Notepad ++:删除包含“正确”一词的行及其上方的两行答案

2023-04-11 18:18| 来源: 网络整理| 查看: 265

我有一个这样的文本文件:

010 2015.06.29 09:57:57.731 WARN ALWAYS_SAME_TEXT] No notaris found with the given strings (used postadres): DIFFERENT_TEXTS 010 2015.06.29 09:57:58.220 WARN ALWAYS_SAME_TEXT] No tussenpersoon found with the given strings: DIFFERENT_TEXTS 010 2015.06.29 09:57:59.288 WARN ALWAYS_SAME_TEXT] More than one cluster (2) found with the given string: DIFFERENT_TEXTS 010 2015.06.29 09:58:00.192 WARN ALWAYS_SAME_TEXT] More than one cluster (2) found with the given string: DIFFERENT_TEXTS 010 2015.06.29 09:58:02.766 WARN ALWAYS_SAME_TEXT] No notaris found with the given strings (used bezoekadres): DIFFERENT_TEXTS Trying to retrieve notaris with postadres instead of bezoekadres 010 2015.06.29 09:58:02.778 WARN ALWAYS_SAME_TEXT] Correct notaris is found when using the postadres instead of bezoekadres 010 2015.06.29 09:58:03.647 WARN ALWAYS_SAME_TEXT] No notaris found with the given strings (used bezoekadres): DIFFERENT_TEXTS Trying to retrieve notaris with postadres instead of bezoekadres 010 2015.06.29 09:58:03.659 WARN ALWAYS_SAME_TEXT] Correct notaris is found when using the postadres instead of bezoekadres 010 2015.06.29 09:58:03.991 WARN ALWAYS_SAME_TEXT] No notaris found with the given strings (used bezoekadres): DIFFERENT_TEXTS Trying to retrieve notaris with postadres instead of bezoekadres 010 2015.06.29 09:58:04.004 WARN ALWAYS_SAME_TEXT] No notaris found with the given strings (used postadres): DIFFERENT_TEXTS

我想要实现的是删除以下所有行(包含“正确”一词):

Correct notaris is found when using the postadres instead of bezoekadres

包括它上面的两行。所以在上面的例子中,我想删除以下几行:

010 2015.06.29 09:58:02.766 WARN ALWAYS_SAME_TEXT] No notaris found with the given strings (used bezoekadres): DIFFERENT_TEXTS Trying to retrieve notaris with postadres instead of bezoekadres 010 2015.06.29 09:58:02.778 WARN ALWAYS_SAME_TEXT] Correct notaris is found when using the postadres instead of bezoekadres 010 2015.06.29 09:58:03.647 WARN ALWAYS_SAME_TEXT] No notaris found with the given strings (used bezoekadres): DIFFERENT_TEXTS Trying to retrieve notaris with postadres instead of bezoekadres 010 2015.06.29 09:58:03.659 WARN ALWAYS_SAME_TEXT] Correct notaris is found when using the postadres instead of bezoekadres 注意:ALWAYS_SAME_TEXT 和 DIFFERENT_TEXTS 被替换为 保密。如名称所述,ALWAYS_SAME_TEXT 是 总是同一段文字,而DIFFERENT_TEXTS 有 每个日志行有不同的文本。

我知道我可以使用 Ctrl + F -> Mark-tab -> Bookmark line checkbox -> Mark all 和 Search-term Correct,但是我怎样才能在包含字"Correct",如果这在记事本++中是可能的。它们太多了,无法手工标记。

其实我问错了,让我再试一次:

我有一个.txt 文件,其中包含上例中的日志行,并且想要删除包含单词Correct 的所有行以及该行上方的每两行。我更喜欢在 Notepad++ 中执行此操作,但如果有人有一个简单的复制粘贴文件,我可以在 Visual Studio 中运行以实现相同的目标,我也可以。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3