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.
Filter to display files that have an accompanying secondary file with different extension present
Re: Filter to display files that have an accompanying secondary file with different extension present
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.
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
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!
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
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
Confirmed working, thanks.
Re: Filter to display files that have an accompanying secondary file with different extension present
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,
-------------
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
Is it enough to ignore anything after the brackets?f:\folder with subfolders\filename(720p_30fps_H264-192kbit_AAC).mp4
f:\folder with subfolders\filename(192kbit_AAC).m4a
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
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
yes, the content in brackets should be ignored.Is it enough to ignore anything after the brackets?
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...
This second regex seems to be perfect!regex:^(.*)\([^()]*\)\.(m4a|mp4)$ dupe:regmatch1;!ext
thanks a lot
Re: Filter to display files that have an accompanying secondary file with different extension present
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$
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
perfect!regex:^(.*)\([^()]*\)\.m4a$ siblingfile:$1:*.mp4
-or-
regex:^(.*)\([^()]*\)\.m4a$ regex:siblingfile:^$1:.*mp4$
thank you