Page 1 of 1

Filter to display files that have an accompanying secondary file with different extension present

Posted: Tue Oct 25, 2022 11:55 pm
by mvdeckard
I've been trying to figure out whether filters or macros can achieve this, or whether it's even possible: filter on displaying only files that have an accompanying file with a different extension, without displaying the file with the different extension.

Example:

C:\Folder\Filename.mp3
C:\Folder\Filename.book (a bookmark file)

I want to filter on only the MP3 files that have a bookmark file present in the same folder, without displaying the bookmark file in the results view.

Thanks.

Re: Filter to display files that have an accompanying secondary file with different extension present

Posted: Tue Oct 25, 2022 11:59 pm
by void
This will be possible in Everything 1.5 with file-exists:

In Everything 1.5, please try the following search:

regex:^(.*)\.mp3$ fileexists:\1.book

regex: = enable regular expressions.
^ = match the start of the filename
( ) = capture the match which we later recall with \1
\. = match a literal .
mp3 = match literal mp3
$ = match end of the filename.
fileexists: = match if there is an existing file with the specified name in the index.
\1 = recall the stem part that we captured from the regular expression.
.book = match literal .book extension.


This will show the mp3 files in the results that have a book sibling.
The .book file will not be shown in your results.

Re: Filter to display files that have an accompanying secondary file with different extension present

Posted: Wed Oct 26, 2022 12:44 am
by mvdeckard
Wow thanks for the lightning fast reply. Looks like that works for locally indexed files, but not when I connect to an ETP Server that's still on v1.4. I'm assuming I'll need to upgrade my remote ETP Server to 1.5a as well then.

Fantastic stuff here, Everything just keeps getting better, and I'm always referring people to it who complain about native search in Windows 10/11 still being awful and slow. Thank you, thank you!

Re: Filter to display files that have an accompanying secondary file with different extension present

Posted: Wed Oct 26, 2022 5:26 am
by void
The above search will work if you upgrade your ETP server to Everything 1.5.

Re: Filter to display files that have an accompanying secondary file with different extension present

Posted: Wed Oct 26, 2022 9:25 pm
by mvdeckard
Confirmed working, thanks.

Re: Filter to display files that have an accompanying secondary file with different extension present

Posted: Sat Dec 17, 2022 6:48 pm
by mmarlyse
Quote from above:
-------------
regex:^(.*)\.mp3$ fileexists:\1.book
This will show the mp3 files in the results that have a book sibling.
Example:
C:\Folder\Filename.mp3
C:\Folder\Filename.book (a bookmark file)
------------
i'm trying in vain to modify the regex to manage this example:

f:\folder with subfolders\filename(720p_30fps_H264-192kbit_AAC).mp4
f:\folder with subfolders\filename(192kbit_AAC).m4a

If the folders contain an .mp4 AND an .m4a, I want to delete the .m4a
If they doesn't contain an .mp4, just skip and keep the .m4a

Only the .m4a-files to be deleted should be displayed
the filenames are NOT siblings. The end of their names differ.

thanks in advance,

Re: Filter to display files that have an accompanying secondary file with different extension present

Posted: Sat Dec 17, 2022 10:46 pm
by void
f:\folder with subfolders\filename(720p_30fps_H264-192kbit_AAC).mp4
f:\folder with subfolders\filename(192kbit_AAC).m4a
Is it enough to ignore anything after the brackets?

Please try the following search:

Code: Select all

regex:^(.*)\(([^()]*)\)\.m4a$ fileexists:\1(720p_24fps_H264-\2).mp4 | fileexists:\1(1080p_24fps_H264-\2).mp4 | fileexists:\1(720p_25fps_H264-\2).mp4 | fileexists:\1(1080p_25fps_H264-\2).mp4 | fileexists:\1(720p_30fps_H264-\2).mp4 | fileexists:\1(1080p_30fps_H264-\2).mp4 | fileexists:\1(720p_60fps_H264-\2).mp4 | fileexists:\1(1080p_60fps_H264-\2).mp4
It's not ideal because Everything must have the full name for the fileexists: call.
I'll look into adding a function that does a fileexist: with a search.
Hopefully this catches most files for you...



The following search may help:
regex:^(.*)\([^()]*\)\.(m4a|mp4)$ dupe:regmatch1;!ext

regex:^(.*)\([^()]*\)\.(m4a|mp4)$ = will match your mp4 AND m4a files
dupe:regmatch1;!ext = will remove any items that don't share the same 'filename' (ignoring anything in the trailing brackets), only items with different extensions are kept.

Double check the results, sort by extension if you want to select all the m4a files.

Re: Filter to display files that have an accompanying secondary file with different extension present

Posted: Sun Dec 18, 2022 7:35 am
by mmarlyse
Is it enough to ignore anything after the brackets?
yes, the content in brackets should be ignored.
Many other different contents exists, I fear they can't all be listed in your first (already long) regex-string
f.i.
(356p_30fps_H264-128kbit_AAC)
(480p_30fps_H264-128kbit_AAC)
and more...
regex:^(.*)\([^()]*\)\.(m4a|mp4)$ dupe:regmatch1;!ext
This second regex seems to be perfect!
thanks a lot

Re: Filter to display files that have an accompanying secondary file with different extension present

Posted: Thu Dec 22, 2022 5:47 am
by void
Everything 1.5.0.1332a adds $0: - $9: support to sibling: functions.

You can now perform searches based on previous regex matches.

For example:

regex:^(.*)\([^()]*\)\.m4a$ siblingfile:$1:*.mp4
-or-
regex:^(.*)\([^()]*\)\.m4a$ regex:siblingfile:^$1:.*mp4$

Re: Filter to display files that have an accompanying secondary file with different extension present

Posted: Fri Jan 06, 2023 8:33 am
by mmarlyse
regex:^(.*)\([^()]*\)\.m4a$ siblingfile:$1:*.mp4
-or-
regex:^(.*)\([^()]*\)\.m4a$ regex:siblingfile:^$1:.*mp4$
perfect!
thank you