Find duplicate files and show the smallest version (1),(2)

Discussion related to "Everything" 1.5.
Post Reply
kinglifer
Posts: 19
Joined: Mon Aug 14, 2023 4:57 pm

Find duplicate files and show the smallest version (1),(2)

Post by kinglifer »

I have a ton of photos that are duplicates 511299605_1261786142451344_3005812996914051374_n and 511299605_1261786142451344_3005812996914051374_n(1) but one of these files is larger. say 200x200 and one is 1600x1600 I want to show only the smaller of the two. Then I will delete them.

I am not sure how to search in this manner. the (1) could be different (1),(2),(3) but base (the name before brackets) will always be correct. The base might not be the "Original" since some are thumbnails and I assume they got named by order of how the file was saved.

I tried searching and thought I msg only when I ran out of options.
void
Developer
Posts: 19870
Joined: Fri Oct 16, 2009 11:31 pm

Re: Find duplicate files and show the smallest version (1),(2)

Post by void »

Does the following search help:

regex:\(\d+\)\.[^.]+$


regex: == enable regular expressions.
\( == match a literal (
\d+ == match 1 or digits
\) == match a literal )
\. == match a literal .
[^.]+ == match any character (except .) one or more times.
$ == match the end of the filename.



Do you need to check if the base exists?
-If so, please try:

regex:^(.*)\(\d+\)(\.[^.]+$) fileexists:$1:$2:


^ == match the start of the filename
(.*) == match any character any number of times and capture the result in $1:
(\.[^.]+$) == match and capture the extension.
fileexists: == check if the specified filename exists.
$1:$2: == recalls the captured regex group -this will be the base name without the (1) part.



Is there a space before the (
-If so, please try:

regex:^(.*)\s\(\d+\)(\.[^.]+$) fileexists:$1:$2:


\s == match a space.
NotNull
Posts: 5961
Joined: Wed May 24, 2017 9:22 pm

Re: Find duplicate files and show the smallest version (1),(2)

Post by NotNull »

Find duplicate files and show the smallest version (1),(2)
The following will show the smallest versionS

Code: Select all

pic:   regex:^(\d{8,}_\d{8,}_\d{8,}_n) A:=$height:*$width: dupe:1 distinct-sort:A-descending !distinct:1
kinglifer
Posts: 19
Joined: Mon Aug 14, 2023 4:57 pm

Re: Find duplicate files and show the smallest version (1),(2)

Post by kinglifer »

Thank you. Worked perfectly
Post Reply