How do I search for: the grandparent folder of a file?

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
dunc2027
Posts: 8
Joined: Sun Sep 22, 2019 4:11 am

How do I search for: the grandparent folder of a file?

Post by dunc2027 » Sat Mar 13, 2021 10:32 pm

In this case, the parent folders of folders that have mp3s. I've looked through the syntax help and searched the web, but can't seem to find the right combination of "flags".

void
Site Admin
Posts: 6709
Joined: Fri Oct 16, 2009 11:31 pm

Re: How do I search for: the grandparent folder of a file?

Post by void » Sat Mar 13, 2021 10:34 pm

Please try the following search:

child:*.mp3

Does this help?

dunc2027
Posts: 8
Joined: Sun Sep 22, 2019 4:11 am

Re: How do I search for: the grandparent folder of a file?

Post by dunc2027 » Sat Mar 13, 2021 10:38 pm

Thanks for the reply! That gets me folders that have mp3s. Can I get the parent folders of those folders?

I tried variations of child:*\*.mp3 and they did not work.
Neither did child: child: mp3 (ignore the spaces).

EDIT: Actually, since I have already cleared empty folders, perhaps my search should be "folders whose subfolders have no folders". I'll keep looking.

EDIT: I got excited and thought childfoldercount:1 and parents:1 would work, but no. By the way, parents: and depth: seems to only reference the directory folder. Is there no way to use these relative to a wildcarded path?

NotNull
Posts: 2980
Joined: Wed May 24, 2017 9:22 pm

Re: How do I search for: the grandparent folder of a file?

Post by NotNull » Sat Mar 13, 2021 11:01 pm

I can't think of a way to accomplish this in Everything 1.4

However ...
Everything 1.5 has been released. It is an alpha version, so will likely contain issues, but this *is* possible with 1.5:
  • Search for:
    ]c]ext:mp3 regex:"(^.*\\)[^\\]*\\[^\\]*\.mp3$[/c]
  • Right-click one of the header bar entries, like Path or Name
  • Select Search > Regular Expression Match 1
  • In the new column with that same name are the grandparents of your mp3 files

dunc2027
Posts: 8
Joined: Sun Sep 22, 2019 4:11 am

Re: How do I search for: the grandparent folder of a file?

Post by dunc2027 » Sat Mar 13, 2021 11:10 pm

Awesome, I'll check it out. Thank you very much for your help!

NotNull
Posts: 2980
Joined: Wed May 24, 2017 9:22 pm

Re: How do I search for: the grandparent folder of a file?

Post by NotNull » Sat Mar 13, 2021 11:17 pm

Another option, using Everything 1.4 :
(assuming you are on Win10)
  • Search for
    child:*.mp3
  • Export the resulting folders as a parents.txt text file (Menu:File > Export )
  • In File Explorer, browse to the folder where you put parents.txt
  • In the address bar, type CMD , followed by ENTER
  • Paste this command and press ENTER:

    Code: Select all

    @(for /f "usebackq delims=" %x in ("parent.txt") do @echo %~dpx) | sort /uniq /O grandparents.txt
    
  • In grandparents.txt are .. well .. the grandparents :)

dunc2027
Posts: 8
Joined: Sun Sep 22, 2019 4:11 am

Re: How do I search for: the grandparent folder of a file?

Post by dunc2027 » Sat Mar 13, 2021 11:19 pm

Thank you very much!

Post Reply