Search for folders starting or ending with specified text

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
koolestani
Posts: 54
Joined: Wed Feb 12, 2020 5:03 am

Search for folders starting or ending with specified text

Post by koolestani »

Hey there!
I am trying to search for folders that end with a particular text, I understand there is some syntax available for this at https://www.voidtools.com/support/everything/searching/
Use \ to search for partial paths, for example, to find files and folders in a folder ending with documents, search for:

documents\


Use a space to combine searches, for example, to find files and folders containing the text order, located in the folder starting with work, search for:

\work order
The thing is, it shows all files inside the folder ending with that text but not the folder itself. Other than that it works perfectly/accurately.

I did find some success with endwith:<text>, I say some success because it does actually show folders (what i want) along with files, which i can easily restrict to display only folders using the folder: clause. All good till here.

The weird thing is, it displays files and folders that contain the <text> absolutely anywhere in their name, in the beginning, in the end and anywhere in between. So it's doing basically the same thing as simply searching for the <text> without the endwith: clause at all (I actually checked and the results with and without endwith: were exactly the same)!

The same is happening with startwith:<text>,

So to summarize, using
startwith:<text>
or
endwith:<text>
or using neither of them are all producing the exact same results!

So my problem would be solved if the \work & documents\ method can start showing folders in the results.
OR
The startwith:<text> and endwith:<text> clauses would actually work as intended.
Thanks
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search for folders starting or ending with specified text

Post by void »

Please try the folder: search modifier.

For example:

folder:\work

-or-

folder:startwith:work

-or-

folder:startwith:"Program Files"
(use double quotes to escape spaces)
koolestani
Posts: 54
Joined: Wed Feb 12, 2020 5:03 am

Re: Search for folders starting or ending with specified text

Post by koolestani »

Hey
Thanks, this worked! (I feel so dumb, I put a space between the colon and the <text>)
folder:startwith:work

The other method however still doesn't work
folder:\work
Like I said it shows only the files inside the folder ending with that text. Restricting the result to show only folders means no hits in the result.

Thanks for the help :D
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search for folders starting or ending with specified text

Post by void »

folder:\work
Like I said it shows only the files inside the folder ending with that text. Restricting the result to show only folders means no hits in the result.
This search should not be matching files at all.

Could you please confirm?
What was the exact search you used?
What search options do you have enabled under the Search menu?
What filter is active under the Search menu?
koolestani
Posts: 54
Joined: Wed Feb 12, 2020 5:03 am

Re: Search for folders starting or ending with specified text

Post by koolestani »

I meant if I enter \work as the query, only files are listed in the result, no folders.
And if you add folder: to that, well then the result is just empty (because it did not show folders in the previous query)
Sorry if I caused some confusion.
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search for folders starting or ending with specified text

Post by void »

Ah, OK.
I think you are trying to search the basename only.

So you are seeing the expected results with folder:startwith:work

folder:\work should find the same folders along with a heap of other results because \work will match anywhere in the full path.

Please let me know if you are not seeing the expected results.
koolestani
Posts: 54
Joined: Wed Feb 12, 2020 5:03 am

Re: Search for folders starting or ending with specified text

Post by koolestani »

Hey, so the \<text> and <text>\ method never shows folders in the result. I believe this is a mistake (is it not?).
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search for folders starting or ending with specified text

Post by void »

Yes, this would be an issue.
\<text> and <text>\ should show file and folder results.

An example of what Everything will match with: \windows

C:\Windows\notepad.exe
C:\Windows

An example of what Everything will match with: windows\

C:\Windows\notepad.exe

(does not match C:\Windows)



Are you expecting folder only results?
-If so, please use the folder: search modifier.



What version of Everything are you using? (Help -> About)

-If you are using Everything 1.5, please make sure there is no spaces next to \
-In Everything 1.5, a single \ means match folders only.
Use double quotes to escape any spaces.

For example:
"\program files"



Could you please confirm: Does Everything not show any folders when search for: \windows
What search options do you have enabled under the Search menu?
koolestani
Posts: 54
Joined: Wed Feb 12, 2020 5:03 am

Re: Search for folders starting or ending with specified text

Post by koolestani »

Hey, sorry for the late reply
This seems both counterintuitive and asymmetrical, notepad.exe should not show up until Match Path condition is applied.
So a user searches for "keyword", and gets all the folders that contain "keyword" and files that contain "keyword" and NOT the files that do not contain "keyword" but belong to folders that do, UNLESS Match Path condition is applied. This is how I've seen and come to expect Everything to work.
And this:
An example of what Everything will match with: \windows

C:\Windows\notepad.exe
C:\Windows
Is the exact opposite of the normal behavior UNLESS Match Path condition is applied.
It's like Match Path is forced into this query.
This makes it counterintuitive.

I hope I am making sense.

Furthermore this:
An example of what Everything will match with: windows\

C:\Windows\notepad.exe

(does not match C:\Windows)
The part about not matching C:\Windows makes it asymmetrical.

Is there any chance this will be fixed in a future release? I'd like to think it's a small but important thing to fix.

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

Re: Search for folders starting or ending with specified text

Post by void »

Using a path separator (\) in your search will match the full path and filename. (same as enabling match path)

Are you expecting \windows to match folders only starting with windows?
What would you like \windows to match?

Are you expecting Windows\ to match folders ending with windows?

The path_search_type gives a lot of options to control how Everything interprets the \
However, there's no real option here to match folders only starting with text.



If you are using Everything 1.5, please make sure there is a space between the \ and the text
\ by itself will match folders only.

For example:

Code: Select all

\ work


Enabling match_start_of_filename_with_caret and match_end_of_filename_with_dollar_sign might be helpful?

This will allow you to search for:
^work
documents$

instead of:
startwith:work
endwith:documents

To enable match_start_of_filename_with_caret and match_end_of_filename_with_dollar_sign:
  • In Everything 1.5, copy and paste the following into your Everything search box:
    /match_start_of_filename_with_caret=1
  • Press ENTER in your Everything search box.
  • If successful, match_start_of_filename_with_caret=1 is shown in the status bar for a few seconds.
    ---
  • Copy and paste the following into your Everything search box:
    /match_end_of_filename_with_dollar_sign=1
  • Press ENTER in your Everything search box.
  • If successful, match_end_of_filename_with_dollar_sign=1 is shown in the status bar for a few seconds.
tuska
Posts: 1052
Joined: Thu Jul 13, 2017 9:14 am

Re: Search for folders starting or ending with specified text

Post by tuska »

2void
Please remove the blank above...

Code: Select all

/match_start_of_filename_with_caret =1
... should be

Code: Select all

/match_start_of_filename_with_caret=1
The message in the status bar reads:

Code: Select all

match_start_of_filename_with_caret=1
Thanks!
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search for folders starting or ending with specified text

Post by void »

Updated, thanks!
koolestani
Posts: 54
Joined: Wed Feb 12, 2020 5:03 am

Re: Search for folders starting or ending with specified text

Post by koolestani »

Using a path separator (\) in your search will match the full path and filename. (same as enabling match path)
Why?
Are you expecting \windows to match folders only starting with windows?
What would you like \windows to match?
I am expecting it to match files and folders starting with windows (and more importantly not match, the files that do not start with windows but belong to folders that do - its just too confusing and not in line with the normal search behavior). After that, I know how to filter the results to show only folders or only files as per my need in a given situation.

That path_search_type thing seems too much to wrap my head around.

I am currently using version 1.4.1.877. If match_start_of_filename_with_caret and match_end_of_filename_with_dollar_sign are not available in versions before 1.5 then I should probably update and give it a try because it looks like what I am asking for.

Thanks again. :D
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search for folders starting or ending with specified text

Post by void »

Using a path separator (\) in your search will match the full path and filename. (same as enabling match path)
Why?
\ is not a valid character for filenames on Windows.

Instead of matching nothing, Everything will match the full path and filename.



For example:
Find Everything in your downloads folder:

\downloads everything



Find your hosts file in your windows folder:

\windows \hosts



Find Everything in your Program Files folder:

\program everything
anmac1789
Posts: 669
Joined: Mon Aug 24, 2020 1:16 pm

Re: Search for folders starting or ending with specified text

Post by anmac1789 »

if ypur using \ its going to match and expand on the path because a slash basically means there contains another subfolder or a file. You could use a partial path command to search only folders

folders: path-part:"\Downloads"

Let us know if this worked.
koolestani
Posts: 54
Joined: Wed Feb 12, 2020 5:03 am

Re: Search for folders starting or ending with specified text

Post by koolestani »

Is this path-part thing only available in version 1.5 because it doesn't seem to work at all for me.
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search for folders starting or ending with specified text

Post by void »

path-part: is in Everything 1.5 or later.

It's tricky to do a path-part search in Everything 1.4, please try the following search:

*\downloads*\*

Disable Tools -> Options -> Search -> Match whole filename when using wildcards to shorten the search to:
\downloads*\
koolestani
Posts: 54
Joined: Wed Feb 12, 2020 5:03 am

Re: Search for folders starting or ending with specified text

Post by koolestani »

Ah I see, that's a neat trick. I noticed the difference between path-part and match path.

path-part matches

files/folders that do not contain the keyword in their name and their locations' path does contain the keyword.
files/folders whose names BEGINS with the keyword and their locations' path does contain the keyword.

match path matches
files/folders that contain the keyword in their name and their locations' path does not contain the keyword.
files/folders that do not contain the keyword in their name and their locations' path does contain the keyword.
both the files/folders and their locations' path do contain the keyword.
Post Reply