Limit search to folder depth
-
pjdevries
- Posts: 53
- Joined: 24 Nov 2009 14:03
Limit search to folder depth
Is it possible to somehow limt a search to a maximum folder depth, similar to the Linux "find -maxdepth" command? If not, consider it a wish and while you're at it, also consider to implement the "-mindepth" functionality 
-
Stefan
- Posts: 1360
- Joined: 18 Nov 2008 21:47
- Location: Europe
Re: Limit search to folder depth
Support +1pjdevries wrote:limit a search to a maximum folder depth
Knowing that an searched file could only be present into first some sub-folders
and the ability to limit the search-sub-folder-depth to n folder,
would be nifty (read: saving time) often in large structures.
Since such feature should be into the InfoPane
on the Find Files - Names & Location tab
next to "[ ] Include subfolders" - "Depth: [ 0]"
and i didn't see there anything like this... - i guess this is not implemented right now?!
Neither it is respected right now in the Roadmap at http://www.xyplorer.com/xyfc/viewtopic.php?f=10&t=830
For "-mindepth" i see no use.
-
pjdevries
- Posts: 53
- Joined: 24 Nov 2009 14:03
Re: Limit search to folder depth
Both -maxdepth and -mindeph have the same, thoug not necessarily as much, advantages in terms of time saving. In fact any option that limits the number of folders that need to be traversed and analysed, has the same advantage for that matter.
Apart from time saving, both -mindepth and -maxdepth have another advantage. They allow you to exclude files and folders from the search results, which is usefull for certain mass rename jobs.
Apart from time saving, both -mindepth and -maxdepth have another advantage. They allow you to exclude files and folders from the search results, which is usefull for certain mass rename jobs.
-
admin
- Site Admin
- Posts: 66350
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Limit search to folder depth
Yep, nice feature. This could easily be added to the code. But I'm not sure about the GUI. There's a lot of space on the "Size" tab, but from the logics it should be rather near the "Include Subfolders" checkbox (where is definitely no space).
FAQ | XY News RSS | XY X
-
pjdevries
- Posts: 53
- Joined: 24 Nov 2009 14:03
Re: Limit search to folder depth
Maybe introduce a new tab, called Traversal or something similar, and move all location related checkboxes (not the location selectbox itself) and the new min-/maxdepth feature to that tab?
-
admin
- Site Admin
- Posts: 66350
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Limit search to folder depth
I find this a quite good proposal (while offering only max depth, of course).Stefan wrote:Since such feature should be into the InfoPane
on the Find Files - Names & Location tab
next to "[ ] Include subfolders" - "Depth: [ 0]"
However, it further adds to an already packed GUI area, and I wonder how many users would actually use this setting.
An alternative would be to offer it only as a switch in a QNS (quick name search).
Code: Select all
*.txt /rd2Would look for all *.txt in this level and the next 2 deeper levels.
Could be simplified to:
Code: Select all
*.txt /d2FAQ | XY News RSS | XY X
-
Stefan
- Posts: 1360
- Joined: 18 Nov 2008 21:47
- Location: Europe
Re: Limit search to folder depth
Better then nothing and still useful.admin wrote: An alternative would be to offer it only as a switch in a QNS (quick name search).= recurse, depth 2Code: Select all
*.txt /rd2
Would look for all *.txt in this level and the next 2 deeper levels.
Brainstorming:
- C:\WINDOWS\?*.log = recursive unlimited
- C:\WINDOWS\?*.log /d0 = recursive disabled, THIS folder only
- C:\WINDOWS\?*.log /d1 = THIS folder and next sub-folder level
- C:\WINDOWS\?*.log /d2 = THIS folder and next two sub-folder levels
------------
Admin>QNS
I found this QNS here:
Help > Address Bar > "Quick Name Searches"
C:\WINDOWS\?*.log = Find all LOGs in C:\WINDOWS\
How about /min /max ?
Or /minD /maxD
C:\WINDOWS\?*.log /min1 /max1 = Find all LOGs in same level as C:\WINDOWS\system32\
Or /rn-m
r = recursive
n = min
m = max
- C:\WINDOWS\?*.log /r2-5 = second till fifth sub-level
- C:\WINDOWS\?*.log /r0 = not recursive
- C:\WINDOWS\?*.log /r1 = first sub-level only
- C:\WINDOWS\?*.log /r0-5 = all till fifth
------------
Thinking more about -mindepth i see the use now:
X:\Customers(L0)\2008(L1)\agreement_for_X.doc
X:\Customers(L0)\2009(L1)\ABC(L2)\agreement_for_X.doc
X:\Customers(L0)\2009(L1)\XYZ(L2)\agreement_new.doc
X:\Customers(L0)\2009(L1)\agreement_template.doc
X:\Customers(L0)\2010(L1)\POI(L2)\
X:\Customers(L0)\2010(L1)\ASD(L2)\
X:\Customers\?agreement*.doc /min2
XYplorer Beta Club