Feature request: Search in searched results



  • Hi, I want search a phrase and after, search other in their results.

    Example:

    file1.txt: THE HOUSE IS WHITE AND THE CAR IS RED.
    file2.js: // THE HOUSE IS WHITE AND THE CAR IS GREEN
    file3.txt: THE HOUSES ARE GREEN
    file4.log: THE PLANES ARE WHITE AND THE SKY IS BLUE

    I want search the files that contains the words “HOUSE”, “WHITE”, “GREEN”

    Search1 “HOUSE”: Results: file1.txt, file2.js, file3.txt
    Search2 “WHITE”: Results: file1.txt, file2.js
    Search3 “GREEN”: file2.js

    Thank you.



  • @FelipeR-Ricardo

    Revised answer soon…



  • @FelipeR-Ricardo

    I think you can already do this…or at least something very close. Here’s what I tried based upon your example:

    Find All in All Opened Documents for “HOUSE”. After that search the Find result panel looks like this:

    Imgur

    Right-click in the white area of the Find result panel and choose Find in this finder… from the menu that pops up. Input “WHITE” in the Find what box and press the Find all button. At this point a SECOND Find result panel tab will show with some new results:

    Imgur

    Right-click in the white area of this newest Find result panel and choose Find in this finder… from the menu that pops up. Input “GREEN” in the Find what box and press the Find all button. This gives the THIRD and final result:

    Imgur

    Unfortunately, the caption of the Find result panel always indicates “3 hits”. It seems like it should change to “2 hits” for the second search and “1 hit” for the third search. However, the blue/purple line in the output for each search shows the correct number of hits in the correct number of files, so in practical terms it is okay.

    If this (or ANY posting on the Notepad++ Community site) is useful, don’t reply with a “thanks”, simply up-vote ( click the ^ in the ^ 0 v area on the right ).



  • A key point that I missed–but it worked anyway because it is the default option–is to check the Search only in found lines checkbox in the two Find in finder searches above. Otherwise, ALL LINES of the files hit in the prior searches get examined in subsequent searches, instead of only the lines that were hit earlier.

    Imgur


Log in to reply