Searching only folder path and not filename

General discussion related to "Everything".
Post Reply
jaychris
Posts: 5
Joined: Tue Jan 18, 2022 6:35 am

Searching only folder path and not filename

Post by jaychris »

Wonderful tool! My first question here.

I would like to list all files in folders whose name (folder name) matches a pattern, but it shouldn't just match the filename. For eg.

Folder File(s)
my music song1, song2, musicsong1, song4
ur music song5, song6
songs musicsong2, song7
folder1 song8, song9

If my pattern is "music", I would like to see the following files matching

my music/song1, song2, musicsong1, song4
ur music/song5, song6

It shouldn't match songs/musicsong2. If I just search for music, then it will list this also.

Is it possible to get this behavior? Actually I want to add more search terms beyond this, but basically I want to restrict my search to only those folders which has a pattern.

Thanks.
void
Developer
Posts: 16734
Joined: Fri Oct 16, 2009 11:31 pm

Re: Searching only folder path and not filename

Post by void »

Please try the following searches:
my music song1, song2, musicsong1, song4
"my music\" song1|song2|musicsong1|song4|"a song with a space"
ur music song5, song6
"ur music\" song5|song6
songs musicsong2, song7
songs\ musicsong2|song7
folder1 song8, song9
folder1\ song8|song9


"" = escape spaces
\ = match full path and filename (if there is no \ in the search term, only the filename part is matched)
space = AND
| = OR


Consider enabling Match Path from the Search Menu and searching for:

my music song1|song2|musicsong1|song4|"a song with a space"

Note: with Match Path enabled, song1, song2, musicsong1, song4 can match anywhere in the full path and filename.
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Searching only folder path and not filename

Post by raccoon »

@void: Without regex, is there any way to search for text in just the Path column, such that you see all the content from those matching paths?

I was hoping perhaps parent:*music* would work, but it requires a fully qualified path name.

@jaychris: The solution with regex is:

regex:path:"music.*\\"
(or just regex:"music.*\\")
jaychris
Posts: 5
Joined: Tue Jan 18, 2022 6:35 am

Re: Searching only folder path and not filename

Post by jaychris »

Thanks for replying. Probably I didn't phrase my question properly (also the post collapsed the alignment adding to the confustion). I will try to put it clearly.

What I listed originally is my file structure and not search examples (attached a picture of ls -R) which is an example to explain my requirement (I am trying to search 1000s of files)

Image

In Everything, I want to put one search phrase to search the folder structure (in the image) which will filter out and show only

mymusic/song1
mymusic/song2
mymusic/musicsong1
mymusic/song4
urmusic/song5
urmusic/song6

and not

songs/musicsong2

I want to find all those files which are in folders, the folder names has a string. In other words, the search should only work on the folder name and not on file name (opposite of nopath:).

Partially I got the answer using \ (music\ as search string worked) but I found that if the string is part of folder name and not full (say mymusicfolder), it doesn't match. Not sure if it is possible with regex. I tried with regex and it didn't seem to work.

Just to give context, I am not a newbie, using Everything for a few years now and very good with regex, combining different criteria, etc.

Thanks.
Attachments
Clipboard01.jpg
Clipboard01.jpg (17.49 KiB) Viewed 18134 times
jaychris
Posts: 5
Joined: Tue Jan 18, 2022 6:35 am

Re: Searching only folder path and not filename

Post by jaychris »

raccoon wrote: Tue Jan 18, 2022 7:04 am @void: Without regex, is there any way to search for text in just the Path column, such that you see all the content from those matching paths?

I was hoping perhaps parent:*music* would work, but it requires a fully qualified path name.

@jaychris: The solution with regex is:

regex:path:"music.*\\"
(or just regex:"music.*\\")
Thanks raccoon, you nailed it. My longwinded second post can be ignored :)

I tried something similar with regex and it didn't work (you have pointed that too). But the pattern you gave worked and my request is addressed.

I second your request to do this without regex, but for now this is great!

Thanks.
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Searching only folder path and not filename

Post by raccoon »

Code: Select all

        _
       /(|
      (  :
     __\  \  _____
   (____)  `|   |
  (____)|   |   |
   (____).__|   |
    (___)__.|___|_
    
void
Developer
Posts: 16734
Joined: Fri Oct 16, 2009 11:31 pm

Re: Searching only folder path and not filename

Post by void »

@void: Without regex, is there any way to search for text in just the Path column, such that you see all the content from those matching paths?
pathpart:foobar

-or-

pathpart:"\program files\everything"


Hint: Right click the Path column header and click Search for Path
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Searching only folder path and not filename

Post by raccoon »

Nice. thanks! I keep forgetting about that menu option. You did indeed tell me about basename: before... i'm dumb.

I notice that pathpart:music doesn't show any bolded match text. Not sure if intentional.
void
Developer
Posts: 16734
Joined: Fri Oct 16, 2009 11:31 pm

Re: Searching only folder path and not filename

Post by void »

It is intentional.

Highlighting regular search terms is a completely different code path than highlighting property search terms.

I'll put this on my TODO list.
Thanks for the suggestion.

Other properties that would also benefit from highlighting: parent-name:, parent-path: (path-part:), stem:, extension: and basename:
This could then lead into highlighting other properties, such as Comment or Tags.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Searching only folder path and not filename

Post by NotNull »

raccoon wrote: Tue Jan 18, 2022 7:04 am @void: Without regex, is there any way to search for text in just the Path column, such that you see all the content from those matching paths?
\*text*\
should do it too. (or was this question indeed meant to be exclusively answered by @void?)
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Searching only folder path and not filename

Post by raccoon »

@NotNull: The globbing search term: \*pathtext*\ with Match Path turned on will produce some useful results, but it will also display matching folder names into the Name column that are not in a matching Path themselves. He is looking for files and folders contained within a parent or ancestor that matches. The exercise was to discover pathpart: without knowing that I should have already known, but I was distracted by thoughts of path:, !files:, parent:.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Searching only folder path and not filename

Post by NotNull »

raccoon wrote: Tue Jan 18, 2022 6:19 pm ... but it will also display matching folder names into the Name column that are not in a matching Path themselves.
Can you give an example of such behaviour?
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Searching only folder path and not filename

Post by raccoon »

Your solution would have answered his question too.
jaychris
Posts: 5
Joined: Tue Jan 18, 2022 6:35 am

Re: Searching only folder path and not filename

Post by jaychris »

NotNull wrote: Tue Jan 18, 2022 6:02 pm
raccoon wrote: Tue Jan 18, 2022 7:04 am @void: Without regex, is there any way to search for text in just the Path column, such that you see all the content from those matching paths?
\*text*\
should do it too. (or was this question indeed meant to be exclusively answered by @void?)
This doesn't work for me. Is this for version 1.4? Also pathpart: doesn't work in 1.4 also. Let me know if this is for 1.5 alpha. I can try that if that works.

Thanks.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Searching only folder path and not filename

Post by NotNull »

Does your searchtext contain a space? In that case, enclose the search in double quotes : "\*your text*\"

jaychris wrote: Tue Jan 18, 2022 7:27 pm This doesn't work for me.
That doesn't help us much ... What kind of results *do* you get? What kind of results are missing?
It should work for version 1.4 as well as 1.5.
raccoon wrote: Tue Jan 18, 2022 6:50 pm Your solution would have answered his question too.
It was your question .. ;)
jaychris
Posts: 5
Joined: Tue Jan 18, 2022 6:35 am

Re: Searching only folder path and not filename

Post by jaychris »

@NotNull: (\*text*\) This is working after disabling the option Option->Search->Match whole filename when using wildcards. Thanks a lot for the help.

pathpart: still not working in 1.4 though (or I am doing something wrong).

Thanks.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Searching only folder path and not filename

Post by NotNull »

pathpart: is new in version 1.5, so not available in 1.4.
jaychris wrote: Tue Jan 18, 2022 7:47 pm This is working after disabling the option Option->Search->Match whole filename when using wildcards.
If you want that setting enabled on 1.4, you can use
"*\*your text*\*"
void
Developer
Posts: 16734
Joined: Fri Oct 16, 2009 11:31 pm

Re: Searching only folder path and not filename

Post by void »

Everything 1.5.0.1299a adds highlighting support to all columns.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Searching only folder path and not filename

Post by NotNull »

void wrote: Thu Feb 03, 2022 6:08 am Everything 1.5.0.1299a adds highlighting support to all columns.
Thanks! I didn't know I needed that :)
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Searching only folder path and not filename

Post by raccoon »

It was in response to
raccoon wrote: Tue Jan 18, 2022 9:32 am I notice that pathpart:music doesn't show any bolded match text. Not sure if intentional.
So now the text "music" will be bold in the search results as it does with normal text searches, so you can easily spot the matches.
void
Developer
Posts: 16734
Joined: Fri Oct 16, 2009 11:31 pm

Re: Searching only folder path and not filename

Post by void »

Thank you for the feedback.

stem:, basename: and extension: will now also highlight the name column.

pathpart:, parentpath: and parentname: will now highlight the path column.

Technically not all columns support highlighting, it's only 'text' columns.
SuperDude
Posts: 221
Joined: Thu Sep 25, 2014 7:57 pm

Re: Searching only folder path and not filename

Post by SuperDude »

void wrote: Thu Feb 03, 2022 10:08 am Thank you for the feedback.

stem:, basename: and extension: will now also highlight the name column.

pathpart:, parentpath: and parentname: will now highlight the path column.

Technically not all columns support highlighting, it's only 'text' columns.
What does only text columns mean? Some of my columns are Dimensions and Length. I would like to make the Dimensions and Length column headers a Yellow color, so they will pop/stand out when looking at Movie and various image properties. How do I go about doing this?
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Searching only folder path and not filename

Post by raccoon »

SuperDude wrote: Thu Feb 03, 2022 8:20 pm What does only text columns mean? Some of my columns are Dimensions and Length. I would like to make the Dimensions and Length column headers a Yellow color, so they will pop/stand out when looking at Movie and various image properties. How do I go about doing this?
This conversation was about the content of columns, not their headers. Colorization of column headers has been suggested in a separate thread. That feature will not care about text vs date vs number columns, so fret not.
Post Reply