Find folders with a depth:7 but display the folder at depth:6

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
TersonWatt
Posts: 19
Joined: Wed Oct 26, 2022 7:21 am

Find folders with a depth:7 but display the folder at depth:6

Post by TersonWatt »

I've used depth:7 to find all the folders that are seven deep but I cannot come up with the correct syntax to display the folders at level six that only have folders that go to level seven, highlighted in yellow on screen grab. Any help in solving this would be much appreciated. Thanks in advance.

"J:\0Complete\000 DOWNLOADS\RAR MAD Magazine (001-550)\000 two folders\" depth:7
Screen grab:
depth7.jpg
depth7.jpg (1.08 MiB) Viewed 10437 times
Last edited by TersonWatt on Wed Nov 16, 2022 11:42 pm, edited 1 time in total.
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Find folders with a depth:7 but display the folder at depth:5

Post by raccoon »

@void: To compliment the parents:<depth> verb, perhaps we could add a children:<depth> verb as well. Where parents: looks for objects with X levels of parents (ancestors), then children: looks for objects with X levels of children (descendants).

I know this will somewhat confuse with childcount: but I can't think of a better verbiage. The existence of parents:<level> sets the precedent. descendants:<level> or descendant-count:<level> works too. "Search for folders containing a child or grandchildren to the specified depth." I'm not sure if this necessitates *-folder and *-file options as well, or should only look for folders.

I tried forming a solution with child:*\*\* and descendant:*\*\* but neither will accept a path string only a single object name.
Last edited by raccoon on Wed Nov 16, 2022 4:45 pm, edited 1 time in total.
TersonWatt
Posts: 19
Joined: Wed Oct 26, 2022 7:21 am

Re: Find folders with a depth:7 but display the folder at depth:5

Post by TersonWatt »

@raccoon Does your reply mean that I'm trying to do something that is not possible with the existing functions?
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Find folders with a depth:7 but display the folder at depth:5

Post by raccoon »

@TersonWatt: We can come up with some solutions I'm sure. Just not sure if there's anything less sloppy than using string manipulation via regex (regular expression) search and capture, and print the results to a new column for sorting and duplicate removal.

I'll let somebody else give it a crack since I may be missing an obvious feature, or a new feature of the experimental Everything 1.5 Alpha.
TersonWatt
Posts: 19
Joined: Wed Oct 26, 2022 7:21 am

Re: Find folders with a depth:7 but display the folder at depth:5

Post by TersonWatt »

@raccoon OK, thanks for your help. I thought this was something that Everything would be able to do with existing functions/syntax. If this is not the case, then using Regex commands is probably too complicated for me and rather than having you guys spent too much time on this I can sort the folders manually. But, if there is a reasonably easy solution to this I'd like to know what it is.
TersonWatt
Posts: 19
Joined: Wed Oct 26, 2022 7:21 am

Re: Find folders with a depth:7 but display the folder at depth:5

Post by TersonWatt »

@raccoon Thanks for mentioning the descendant function.

I was not aware of the descendant functions, so I played around with them and I think I've found the solution:

"J:\0Complete\000 DOWNLOADS\RAR MAD Magazine (001-550)\000 two folders\" descendant-folder-count:2
horst.epp
Posts: 1447
Joined: Fri Apr 04, 2014 3:24 pm

Re: Find folders with a depth:7 but display the folder at depth:5

Post by horst.epp »

Look on my suggestion for a relative Depth level.
viewtopic.php?f=12&t=12219&p=49958#p49958
As a result David made a new search function Parent+x:
Isn't this applicable to your problem ?
TersonWatt
Posts: 19
Joined: Wed Oct 26, 2022 7:21 am

Re: Find folders with a depth:7 but display the folder at depth:5

Post by TersonWatt »

@horst.epp Solved using descendant-folder-count:

I did try Parent+x: but couldn't get the result I was after.
TersonWatt
Posts: 19
Joined: Wed Oct 26, 2022 7:21 am

Re: Find folders with a depth:7 but display the folder at depth:6

Post by TersonWatt »

Thanks for the help and suggestions. Much appreciated.

Although I thought I had cracked it using descendant-folder-count: on further testing it didn't solve the issue. Trying to solve the problem with functions has fried my brain today but what I now realise is that a solution was staring at me. Sorting on the Folder Depth column brings all the folders at level seven together displaying the folder at level six* in the Name field thus allowing me to highlight them and move them to another directory.

If there is a tidier solution using functions I would still like to know.

:oops: Apologies for originally stating level 5 :oops:
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: Find folders with a depth:7 but display the folder at depth:6

Post by void »

Sounds like a depth:6 search would have given your desired results?

Please also consider the following Everything 1.5 search:

"J:\0Complete\000 DOWNLOADS\RAR MAD Magazine (001-550)\000 two folders\*\*"



Combine with child-folder-count: to show only folders that have subfolders.


@void: To compliment the parents:<depth> verb, perhaps we could add a children:<depth> verb as well. Where parents: looks for objects with X levels of parents (ancestors), then children: looks for objects with X levels of children (descendants).
Maybe child-depth: ? max-child-depth:?
I'll consider an option to do this.
Thank you for the suggestion.

I think we also need a descendantfilelist1: search.
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Find folders with a depth:7 but display the folder at depth:6

Post by raccoon »

I think what the OP was asking for, by analogy, is "How can I search all my movies folders for those that have .\Extras\Subs\ or .\Samples\pics\ or any other set of folders that goes 2-deep or more." I assume he's trying to find and flatten them.
TersonWatt
Posts: 19
Joined: Wed Oct 26, 2022 7:21 am

Re: Find folders with a depth:7 but display the folder at depth:6

Post by TersonWatt »

@void & &raccoon Thank you and the others who have replied to my query.

:oops: I am so embarrassed but have learnt a valuable lesson when troubleshooting. :oops:

My screen grab is displaying a better solution for what I wanted to do with the end results i.e. depth:7 and @void's suggestion of depth:6 would have given me what I was asking for.

The lesson I've learnt is that I should have created a sensibly named folder structure and used that to try the functions. The results I was seeing from the original named folder structure caused my confusion.

Once again, thanks for your help which made me see it was my confusion over the name of the folders rather than the functions I was trying.
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: Find folders with a depth:7 but display the folder at depth:6

Post by void »

Everything 1.5.0.1330a adds the following search functions:

Usage example:
depth:6 max-child-depth:>=2
depth:6 descendantfilelist1:

Hold down Ctrl and click the descendantfilelist1: text to set the file list slot.
TersonWatt
Posts: 19
Joined: Wed Oct 26, 2022 7:21 am

Re: Find folders with a depth:7 but display the folder at depth:6

Post by TersonWatt »

Thanks for the update. I haven't delved into filelists yet but I can see how the max-child-depth: function will be useful.

Rather than start a new thread, I hope it's OK to use this thread to ask for help with another similar task.

I'd like to display/search for folders at depth 4 if there is a certain type of file at level 4 and lower levels e.g 5, 6, 7 etc. Once again, I'm struggling with the syntax. In this case, I'm not even sure which functions to use. I can use child:*.flac to get a list of the folders where the flac files are located and, if they are at depth 4, I can move the folders. However, I would also like to move the folders at level 4 if they have flac files at lower depths.

Any help will be much appreciated.
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: Find folders with a depth:7 but display the folder at depth:6

Post by void »

Please try the following search:

descendant:*.flac depth:4

descendant: searches children and grandchildren (subfolders)
child: searches direct children only.
TersonWatt
Posts: 19
Joined: Wed Oct 26, 2022 7:21 am

Re: Find folders with a depth:7 but display the folder at depth:6

Post by TersonWatt »

@void Thanks the swift response and the solution to my query. Much appreciated. Cheers
Post Reply