Page 1 of 1

Highlighting folders that match the contents of a text file?

Posted: 02 Mar 2020 08:27
by Megalith
Let's say I have a text file with the following list:

alfa
bravo
charlie

And I have a file directory with the following folders:

alfa
bravo
charlie
delta
echo

Is there a way I could run the text file through XYplorer and have it only highlight the folder names that match those in the text file (alfa, bravo, charlie)?

Re: Highlighting folders that match the contents of a text file?

Posted: 02 Mar 2020 18:45
by highend

Code: Select all

    $content = readfile("<some path>\<file>.txt");
    $sel = "";
    foreach($line, $content, <crlf>, "e") {
        if (exists("<curpath>\$line") == 2) { $sel .= "<curpath>\$line<crlf>"; }
    }
    selectitems $sel;

Re: Highlighting folders that match the contents of a text file?

Posted: 02 Mar 2020 18:53
by Megalith
Thanks.

I also learned that this can be done with voidtools's Everything search.