Specialt
Specialt

Reputation: 25

Notepad++ Search to Remove Bookmark from lines

I am using Notepad++ to search a file for a specific string and when found, bookmark the line.

What I'd like to be able to do is do a search following the first search to un-bookmark certain lines where the 2nd string of text is found. The first search should still remain bookmarked.

It doesn't seem this is feasible through Notepad++. Inverse bookmark wouldn't work in this scenario either.

Search 1 - I would be searching for where the words "Long-term disability plan - default plan " exist and bookmark the line.
Search 2 - I would want to search for "T","LTD" and un-bookmark lines where that was present.

"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","",""

Upvotes: 2

Views: 888

Answers (1)

AdrianHHH
AdrianHHH

Reputation: 14047

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.

Upvotes: 1

Related Questions