如果有特定的单词Notepad ++,尝试删除行

时间:2014-02-08 03:10:26

标签: notepad++

我已导出报告,该报告提供每日备份状态报告。每个服务器都有一个父作业和子作业,我不关心子作业,因为父作业提供了服务器的实际成功/失败。子作业有单词Default *,如果该单词位于那个我想删除整行。我查看了一些额外的帮助,但无法成功获取截断的行。任何建议将不胜感激。

1 个答案:

答案 0 :(得分:0)

如果我正确理解你的问题,你就会有这样的事情:

Parent 1
Child11 Default
Child12 Default
Parent 2
Child21 Default
Child22 Default more

你想要它导致这个:

Parent 1
Parent 2

如果是这样,以下内容将适用于Notepad ++:

Find:  ^.*Default.*\r\n
Replace:

来自Notepad ++ 6.5.1:

enter image description here

说明:

^.*Default.*\r\n

Options: case insensitive; ^ and $ match at line breaks

Assert position at the beginning of a line (at beginning of the string or 
  after a line break character) «^»
Match any single character that is not a line break character «.*»
   Between zero and unlimited times, as many times as possible, 
   giving back as needed (greedy) «*»
Match the characters “Default” literally «Default»
Match any single character that is not a line break character «.*»
   Between zero and unlimited times, as many times as possible, 
   giving back as needed (greedy) «*»
Match a carriage return character «\r»
Match a line feed character «\n»

Created with RegexBuddy

注意:我不以任何方式与RegexBuddy有关联;我已经用了很长时间来设计和测试各种方言的正则表达式。