Quick search in the directory tree

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
daandi
Posts: 34
Joined: 13 Apr 2012 21:00

Quick search in the directory tree

Post by daandi »

Hello!

I have a question:
I love the quick search/filter function from XyPlorer to search for files in one directory or a file list.

Is there something comparable with which you can also apply a quick filter to the directory tree (with subdirectoryies)?

thank you
CB-Crew, Andreas

Horst
Posts: 1085
Joined: 24 Jan 2021 12:27
Location: Germany

Re: Quick search in the directory tree

Post by Horst »

View / Views / Branch view
Then you can apply Quick search
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
Portable XYplorer (actual version, including betas)
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69

daandi
Posts: 34
Joined: 13 Apr 2012 21:00

Re: Quick search in the directory tree

Post by daandi »

Hello Horst!
thank you very much for your reply, but I think the use of the flat view in my case would be too complicated.

The drive has 215.000 files and 60.500 folders. Quick search first reads all files and folders, shows them all and then starts to calculate all folder sizes. On my computer it takes about 30 seconds to finalize this folder size calculation.

OK, I did find the syntax for flat view (/flatdirs) etc.. This is of course very powerful, but not easy to navigate. The full list comes sorted, by modified date (in my case). Sorting the list by name or path doesn't help me either. Every time I change search filter it has to reread the directory structure.

* My wish
What I was looking for, was a filter field on top of the treeview area, where I can enter the search term and than a filtered tree, that only shows the directory(s) that contain the term, is shown. In natural order (same order as the directories are on the hard disk).

Like a searchable mini tree..
A tree view without the directories that do not fit, in the same order as the full tree...

Maybe I should write this in the board of additional wishes. :biggrin:
Maybe someone can also help me to formulate this a little more clearly and maybe that would be a great new feature....

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Quick search in the directory tree

Post by highend »

There is currently only one way to do that: Scripting...

And it requires a mini tree (and probably two user defined commands / buttons)...
One of my scripts helped you out? Please donate via Paypal

daandi
Posts: 34
Joined: 13 Apr 2012 21:00

Re: Quick search in the directory tree

Post by daandi »

Oh dear, I think Scripting is too complicated for me...

Wouldn't a "TreeSearch" be a nice new feature in XyPlorer ? :)

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Quick search in the directory tree

Post by admin »

a tree filter... hmmm... it's not such a bad idea... does it exist anywhere? never heard about it...

I assume we're only talking about the terminal leaves of a branch, otherwise the tree would quickly disappear entirely.

daandi
Posts: 34
Joined: 13 Apr 2012 21:00

Re: Quick search in the directory tree

Post by daandi »

I think that this can be a very interesting feature for sure. There is certainly to consider exactly how the search should look in detail. Unfortunately I don't know of any other software where you could get some inspiration on how this should look in detail.

One possibility could be to highlight the branches in the directory tree, or to show only the branches that contain the searched term. Or simply a window with the search results. A list with all the paths, in which the searched term is contained.

But there would be many other possibilities to plan something great new :)

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Quick search in the directory tree

Post by admin »

Yeah, needs more thinking. Speed is also a factor (i.e. it might be too slow). I'll consider it...

daandi
Posts: 34
Joined: 13 Apr 2012 21:00

Re: Quick search in the directory tree

Post by daandi »

Yes these directory trees and structures can become quite large...

An exclusion filter, which excludes directories from the search, would certainly also make sense. Like it already exists with the file search function.

For example there is the "Eagle" application (www.eagle.cool). A very interesting image/file management software, but for each captured image it creates its own directory. There are quickly thousands of subdirectories.

You must be able to exclude such "bad guys" from the search...

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Quick search in the directory tree

Post by admin »

Check out the Excluded tab on Info Panel / Find Files (Ctrl+F).

daandi
Posts: 34
Joined: 13 Apr 2012 21:00

Re: Quick search in the directory tree

Post by daandi »

I was thinking about a new search feature in the directory tree.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Quick search in the directory tree

Post by highend »

For mini trees only...

Search script:

Code: Select all

    end (!get("#489")), "No mini tree in use, aborted!";

    $input = trim(input("Search keyword..."));
    if ($input) {
        $tree       = get("tree", <crlf>);
        $esc        = regexreplace($input, "([\\.+(){\[^$])", "\$1");
        $matches    = regexmatches($tree, "^.*?" . $esc . ".*?(?=\r?\n|$)", <crlf>);
        $cntMatches = gettoken($matches, "count", <crlf>);
        end (!$cntMatches), "No match(es) found...";

        perm $P_SAVED_MINI_TREE = $tree;
        loadtree replace($matches, <crlf>, "|");
        status $cntMatches . (($cntMatches == 1) ? " entry" : " entries") . " found...", , "ready";
    }
Restore last mini tree to its state before the last search (this needs to be done after each search^^):

Code: Select all

loadtree replace($P_SAVED_MINI_TREE, <crlf>, "|");
One of my scripts helped you out? Please donate via Paypal

Post Reply