Notepad ++ Search从行中删除书签

时间:2015-11-12 03:23:27

标签: notepad++

我正在使用Notepad ++搜索文件中的特定字符串,找到后,将该行添加为书签。

我希望能够做的是在第一次搜索后进行搜索,以取消标记找到第二个文本字符串的某些行的书签。第一次搜索仍应保留书签。

通过Notepad ++看起来这是不可行的。逆向书签在这种情况下也不起作用。

搜索1 - 我会搜索单词"长期残疾计划 - 默认计划"存在并为该行添加书签。
搜索2 - 我想搜索" T"," LTD"并且取消标记存在的行。

"123","MEDICAL","Anthem gHIP","Employee Only","",274.66,0,0,0,0,0,"20151112","","A","MED","DMPTN","01","",""
"123","LIFE","Basic Life Insurance","3 times salary","330000.00",5.33,0,0,7.75,0,0,"20151112","","A","GTL","","01","",""
"123","SUPLIFE","Voluntary Life Insurance","3.0 times salary","330000.00",0,106.92,4.11,0,0,0,"20151112","","A","VLIFE","","01","",""
"123","SUPCHILDLIFE","Voluntary Child Life Insurance","","",0,0,,0,0,0,"20151112","20151029","W","VLIFC","","01","",""
"123","HSA","Health Savings Account (HSA)","","",0,0,0,0,0,0,"20151112","","A","EEHSA","","01","",""
"123","DENTAL","Delta Dental","Employee Only","",20.75,75,2.88,0,0,0,"20151112","","A","DEN","DMPTN","01","",""
"123","VISION","VSP Vision","Employee Only","",5.13,18,0.69,0,0,0,"20151112","","A","VIS","DMPTN","01","",""
"123","HFSA","Limited Purpose FSA","Medical Contribution","",0,100,33.33,0,0,0,"20151112","","A","LPFSA","","01","",""
"123","SUPSPOUSELIFE","Voluntary Spouse/Domestic Partner Life Insurance","","",0,0,,0,0,0,"20151112","20151029","W","VLIFS","","01","",""
"123","DCFSA","Dependent Care FSA","Depcare Contribution","",0,100,33.33,0,0,0,"20151112","","A","DC125","","01","",""
"123","LTD","Long-term disability plan - default plan ","60% of salary","66000.00",5.08,0,0,0,0,0,"20151112","","A","LTD","","01","",""

"456","MEDICAL","Anthem gHIP","Employee + Family","",719.35,2005.68,,0,0,0,"20151112","20151029","T","MED","DMPTN","01","",""
"456","HFSA","Limited Purpose FSA","Medical Contribution","",0,500,,0,0,0,"20151112","20151029","T","LPFSA","","01","",""
"456","VISION","VSP Vision","Employee + Spouse","",7.93,36,,0,0,0,"20151112","20151029","T","VIS","DMPTN","01","",""
"456","DCFSA","Dependent Care FSA","Depcare Contribution","",0,5000,,0,0,0,"20151112","20151029","T","DC125","","01","",""
"456","LTD","Long-term disability plan - default plan ","60% of salary","110400.00",8.49,0,,0,0,0,"20151112","20151029","T","LTD","","01","",""
"456","HSA","Health Savings Account (HSA)","","",0,0,,0,0,0,"20151112","20151029","T","EEHSA","","01","",""
"456","DENTAL","Delta Dental","Employee + Spouse","",41.49,150,,0,0,0,"20151112","20151029","T","DEN","DMPTN","01","",""
"456","Imputed Income","","","",,,,0,,,"20151112","20151029","T","DMPTN","DMPTN","01","",""

1 个答案:

答案 0 :(得分:1)

Using "Inverse bookmarks" is the way to do this.

Step 1: Search and mark lines containing the first search string. For your example it is "Long-term disability plan - default plan ". Two lines are bookmarked from the example text.

Step 2: Invert the bookmarks. This means that lines that do not have the first search string will be bookmarked. All except two lines from the example text are now bookmarked.

Step 3: Search and mark lines containing the second search string. This should bookmark a few more lines. This means that lines that do not have the first search string plus lines with the second search string will be bookmarked. For your example it is "T","LTD" and whilst there are two matches one is already bookmarked. Now all except one line from the example text is now bookmarked.

Step 4: Invert the bookmarks. This means that lines that have the first search string but do not have the second search string will be bookmarked. Only one line from the example text is now bookmarked.