search a number "greater than" in file name

General discussion related to "Everything".
Post Reply
science2002
Posts: 8
Joined: Fri Sep 22, 2017 10:34 am

search a number "greater than" in file name

Post by science2002 »

Thanks again for this exceptional piece of software.
My question is probably trivial. I read the help file for using the operators, but probably I did not understand everything. Some examples for each operator would have been helpful.

My scenario is the following:
I put in the file names (given the mess of metadata implementation in Windows) the number of "stars" as an indication of its importance for my purposes.
So say for ebooks I have a scale of 5 stars from 1 (star1) to 5 (star5). An example could be the following:
  • Shakespeare_Romeo&Juliet_star4.pdf
    Follett_Notre-Dame_star3.epub
    Unkown_Novel_star2.mobi
I would like to search let say among these ebooks, those with a number of stars greater than 2 (i.e. the search result needs to give the first two ebooks).
I tried to use the simbol ">" (like star ">2"), as well as "gt:", but with no avail. Is it possible to perform such a search?
I know the more obvious workaround, searching for star3 | star4 | star5, or star < 3 | 4 | 5 > but I would prefer (other files have a scale 1-10) the use of "greater than" if possible.
Thanks
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: search a number "greater than" in file name

Post by NotNull »

Try it with:

Code: Select all

ext:mobi;epub;pdf   star<3|4|5>
Meaning search for all .mobi .epub and .pdf files with star3, star4 or star5 in their name.

Tip: If you search for ebooks more often, consider creating a Filter for them.
science2002
Posts: 8
Joined: Fri Sep 22, 2017 10:34 am

Re: search a number "greater than" in file name

Post by science2002 »

Thanks NotNull for your suggestion.

But, as I wrote, I would be interested to know if it can be used the "greater than" or the "number range" functions, if they can work in this kind of search. This is because I also deal with situations where numbers are much more than 5.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: search a number "greater than" in file name

Post by NotNull »

Those ">" you are talking about are used in Functions, like width:>1024

There is no function for what you want.
Furthermore: if there was, that would do a textual comparison, meaning that star12 will not qualify an starwars will.

Another way would be using regular expressions.
Here you can find a regex range generator.
Using the regex generator, if you want to find star8-star24:

Code: Select all

regex:"star([89]|1[0-9]|2[0-4])"
Good luck!

EDIT:
Example fell of somehow... Re-added.
science2002
Posts: 8
Joined: Fri Sep 22, 2017 10:34 am

Re: search a number "greater than" in file name

Post by science2002 »

Thanks again NotNull, also for the exact code you gave.
It seems even to work just doing (using the initial scenario I asked):

Code: Select all

regex:"star([3-5])"
I tried myself the other way, i.e. enabling Regex under Search Menu (shortcut Ctrl-R) and with this script it works:

Code: Select all

 star([3-5])
More in general I noticed that in another post (24.01.2020 called: Several Problems) you mentioned that in a next major release Everything will index and search also metadata. This will be great for searching tags (or keywords) too, although - as mentioned at the beginning of these posts - file metadata in Windows have not been taken very seriously, and with different standards in use they are a mess. But I look forward to this next step of your great utility. Thanks again
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: search a number "greater than" in file name

Post by NotNull »

science2002 wrote: Tue Jan 28, 2020 10:36 pm your great utility
That must be some misunderstanding ... I am not the author of Everything (my coding skills are one step above the "hello world" level).
I just hang around here to help answering forum questions. But I will pass your compliments to @void, the real author of Everything. :)

science2002 wrote: Tue Jan 28, 2020 10:36 pm file metadata in Windows have not been taken very seriously
Agreed!
I don't know how and what Everything will index in the future, but based on void's track record so far I have no doubts that it will be good.
science2002
Posts: 8
Joined: Fri Sep 22, 2017 10:34 am

Re: search a number "greater than" in file name

Post by science2002 »

NotNull wrote: Wed Jan 29, 2020 6:38 pm I am not the author of Everything
I thought you were involved in some way in building or maintaining it. If not so, my congratulations for your dedication and the expertise of your support.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: search a number "greater than" in file name

Post by NotNull »

science2002 wrote: Thu Jan 30, 2020 7:22 pm I thought you were involved in some way in building or maintaining it. If not so, my congratulations for your dedication and the expertise of your support.
Thank you!!
Post Reply