Search the max revision file name.

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
Eris74
Posts: 7
Joined: Tue Jul 25, 2023 1:17 pm

Search the max revision file name.

Post by Eris74 »

Hi to all,
given a filename where the standard search would return the following result:
filename rev A
filename rev B
filename rev C

is there a way to just have "filename rev C" as the result?

Thanks in advance.
NotNull
Posts: 5298
Joined: Wed May 24, 2017 9:22 pm

Re: Search the max revision file name.

Post by NotNull »

Similar question

And this one for the use of expand: to simplify the answer (could not get this working myself with the new pre-processor syntax)
Eris74
Posts: 7
Joined: Tue Jul 25, 2023 1:17 pm

Re: Search the max revision file name.

Post by Eris74 »

Hi NotNull,
thanks a lot for your response.
Actually I had already seen the second link you posted
but my problem is that "filename" doesn't always have the same length
and revisions can go up to the letter Z too.
Do you have any other suggestions in this regard?
Thanks again.
void
Developer
Posts: 15501
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search the max revision file name.

Post by void »

but my problem is that "filename" doesn't always have the same length
Could you please give an example of the filenames?

The search might look something like:

regex:"^(.*) rev ([a-z])$" !expand:file-exists:#<:\1" "rev" "#char:<#eval:<#unicode:<\2>+1>>\3#>:
Eris74
Posts: 7
Joined: Tue Jul 25, 2023 1:17 pm

Re: Search the max revision file name.

Post by Eris74 »

Here are examples of filenames:

370-10-000-491 REV A.SLDDRW
370-10-000-491 REV B.SLDDRW
370-10-000-491 REV C.SLDDRW

370-10-000-524-DT REV A.SLDDRW
370-10-000-524-DT REV B.SLDDRW

I've highlighted the files that the search should return.
void
Developer
Posts: 15501
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search the max revision file name.

Post by void »

Please try:

regex:"^(.*) rev ([a-z])(.*)$" !expand:file-exists:#<:\1" "rev" "#char:<#eval:<#unicode:<\2>+1>>\3#>:
Eris74
Posts: 7
Joined: Tue Jul 25, 2023 1:17 pm

Re: Search the max revision file name.

Post by Eris74 »

I don't know very well the use of expressions, I copied the string as it is in the search field but I don't get any results.
I get something by just writing the part regex:"^(.*) rev ([a-z])(.*)$" but obviously these are not the needed results.
Am I doing something wrong?
horst.epp
Posts: 1352
Joined: Fri Apr 04, 2014 3:24 pm

Re: Search the max revision file name.

Post by horst.epp »

Eris74 wrote: Wed Jul 26, 2023 12:24 pm I don't know very well the use of expressions, I copied the string as it is in the search field but I don't get any results.
I get something by just writing the part regex:"^(.*) rev ([a-z])(.*)$" but obviously these are not the needed results.
Am I doing something wrong?
I guess you need Everything 1.5 for this
NotNull
Posts: 5298
Joined: Wed May 24, 2017 9:22 pm

Re: Search the max revision file name.

Post by NotNull »

1. Check your Everything version (menu:Help > About Everything). You need Everything 1.5 for this to work.

2. Make sure the Everything filter is active and no search modifiers are enabled:
- Open the Search menu item
- Make sure only the Everything entry is enabled

3. Multiple revisions of a file must be in the same folder.


Other than that: works fine here ...
2023-07-26 14_40_24-Windows PowerShell.png
2023-07-26 14_40_24-Windows PowerShell.png (66.54 KiB) Viewed 1594 times
Eris74
Posts: 7
Joined: Tue Jul 25, 2023 1:17 pm

Re: Search the max revision file name.

Post by Eris74 »

seems to work in version 1.5
I will do further tests but now I ask:
Is there a way to apply this filter not to all files but to a list that I open from the menu Search -> Advanced Search -> Search for a list or filename?
In this regard I noticed that in version 1.5 if I open a list, the search does not work: to make it work I have to manually replace the separator ";" with "|" and once done I have to remove the filelist: prefix instead with the previous version it was not necessary.
Do I have to set something?
void
Developer
Posts: 15501
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search the max revision file name.

Post by void »

Please try a file list slot.

Include the following in your search:

filelist1:

Hold down Ctrl and left click the filelist1: text in your search box.
Setup the list of filenames and click OK.


I noticed that in version 1.5 if I open a list, the search does not work:
What search options do you have enabled under the Search menu?
Could you give an example of filelist: search not matching a file correctly?

Does the following search find notepad and explorer:
filelist:c:\windows\notepad.exe;"c:\windows\explorer.exe"
Eris74
Posts: 7
Joined: Tue Jul 25, 2023 1:17 pm

Re: Search the max revision file name.

Post by Eris74 »

this way it works because the filename is written in full.
In version 1.4 I could open the list.txt file from the menu Search -> Advanced Search -> Search for a list of filenames and the search was successful.
Instead now I have to replace ";" with "|" and remove "filelist:" from the search string so that the search is successful
even by entering only part of the file name.
This way however I would have to write the list by hand instead of reading it from the list.txt file.
The same for file list slots, file names must be written in full as I saw.

Let me explain the process well to understand if combining the regex expression with filelist I can achieve my goal:
I have to search for a list of files that is in a txt file.

This is an example of the list.txt file

370-10-000-491
370-10-000-495

The search should return:
370-10-000-491 REV B.SLDDRW
370-10-000-495 REV A.SLDDRW

A and B are the maximum revisions for these 2 files but it could be A..Z

I don't have any options enabled in the search menu.

Thanks again for your help.

UPDATE:
I almost reached my goal:
copying and pasting the filenames from list.txt to everything and adding the filter string
ext:slddrw|dxf regex:"^(.*) rev ([a-z])(.*)$" !expand:file-exists :#<:\1" "rev" "#char:<#eval:<#unicode:<\2>+1>>\3#>:
the search is successful.
We would just like to make it possible to open the list directly from list.txt instead of copy/paste if possible.

And just two last things:
- would there be a way to report files that weren't found when searching for a list?
- is there a way to do a custom export of the results list? I need to export the list as path\name format

Thank you so much, I really appreciate your effort to help me this far!
NotNull
Posts: 5298
Joined: Wed May 24, 2017 9:22 pm

Re: Search the max revision file name.

Post by NotNull »

Eris74 wrote: Thu Jul 27, 2023 8:08 am - would there be a way to report files that weren't found when searching for a list?
No, not without a separate script.

Eris74 wrote: Thu Jul 27, 2023 8:08 am - is there a way to do a custom export of the results list? I need to export the list as path\name format
Yes, in the Export dialog (menu:File > Export), set the Save as type to TXT Text Files (*.txt).
This will save the results in the following format:

Code: Select all

C:\Windows\notepad.exe
C:\Windows\explorer.exe
Eris74
Posts: 7
Joined: Tue Jul 25, 2023 1:17 pm

Re: Search the max revision file name.

Post by Eris74 »

ok, thanks. Another question:
I have to include the "Match Whole Words" option but it works only if I enable it globally from the Search menu
instead I just want it to be activated with a certain filter.
I have seen that within the filters it is possible to enable this option individually but it does not seem to work.
How to do?
NotNull
Posts: 5298
Joined: Wed May 24, 2017 9:22 pm

Re: Search the max revision file name.

Post by NotNull »

If you have just one single search term, precede it with the path: serach modifier

Code: Select all

path:abc

If you have multiple search terms, precede each with the path: serach modifier or precede your query with the ::path: global search modifier:

Code: Select all

path: abc path:123
::path: abc 123


path:
Search modifiers wrote: Prefix a search modifier with :: to enable it globally.
For example, to enable match case for the rest of the search:
::case: FOO BAR
Post Reply