Duplicates in two directories

Discussion related to "Everything" 1.5 Alpha.
Post Reply
harryray2
Posts: 1104
Joined: Sat Oct 15, 2016 9:56 am

Duplicates in two directories

Post by harryray2 »

I have two directories D:\from tosh and D:\from tosh\backup of d
I want to find size duplicates.

How do I just find the duplicates between the two directories and not within a single directory?

I can't remember how to do this...
void
Developer
Posts: 16743
Joined: Fri Oct 16, 2009 11:31 pm

Re: Duplicates in two directories

Post by void »

Please try the following search:

"D:\from tosh\" | "D:\from tosh\backup of d\" dupe:size
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Duplicates in two directories

Post by raccoon »

I think he's asking how to prevent duplicates from matching within the same path (first or second), and to only display duplicates (to be deleted) from the second path.

These should NOT match.

X:\red.file
X:\Copy of red.file
Y:\blue.file
Y:\Copy of blue.file

These SHOULD match.

X:\green.file
Y:\Copy of green.file
void
Developer
Posts: 16743
Joined: Fri Oct 16, 2009 11:31 pm

Re: Duplicates in two directories

Post by void »

Please try excluding your "D:\from tosh\backup of d" folder:

!"D:\from tosh\backup of d\" dupe:size



Include folder A and folder B, for example:

"C:\folder A\" "D:\from tosh\" !"D:\from tosh\backup of d\" dupe:size
harryray2
Posts: 1104
Joined: Sat Oct 15, 2016 9:56 am

Re: Duplicates in two directories

Post by harryray2 »

@raccoon, yes, I want to prevent seeing the duplicates from within the same folder, only duplicated files from the different folders.
harryray2
Posts: 1104
Joined: Sat Oct 15, 2016 9:56 am

Re: Duplicates in two directories

Post by harryray2 »

I've tried a few different ways but can't get this to work.

If I have 3 different files with the same size in "D:\from tosh\backup of d\" and two different files with the same size in "D:\from tosh\"
I only want to compare the duplicates that are in "D:\from tosh\backup of d\" and "D:\from tosh\" NOT the duplicated files within the same folder
void
Developer
Posts: 16743
Joined: Fri Oct 16, 2009 11:31 pm

Re: Duplicates in two directories

Post by void »

Please try the following search:

"D:\from tosh\" column1:=if(regexmatch(path:,"(?i)^D:\\from tosh\\backup of d\\"),"A","B") dupe:size;!column1 addcolumn:column1
harryray2
Posts: 1104
Joined: Sat Oct 15, 2016 9:56 am

Re: Duplicates in two directories

Post by harryray2 »

Thanks,I'll play with that, but it seems to work.
It's a bit complicated though...would it be possible to create a simpler way of doing this?

Possibly along the lines of dupe:size;!rootname? This seems to do the same thing, but across different drives.
void
Developer
Posts: 16743
Joined: Fri Oct 16, 2009 11:31 pm

Re: Duplicates in two directories

Post by void »

dupe:size;!rootname would be ideal, but it's cumbersome..

It would require you to temporarily setup subst drives for each path and then index those paths.

I am looking into easier ways to "mark" files.
harryray2
Posts: 1104
Joined: Sat Oct 15, 2016 9:56 am

Re: Duplicates in two directories

Post by harryray2 »

Thanks, I frequently have to compare files within a directory tree, so an easy way would be useful.
void
Developer
Posts: 16743
Joined: Fri Oct 16, 2009 11:31 pm

Re: Duplicates in two directories

Post by void »

A much easier search:

<"D:\from tosh\backup of d\" col1:=A> | <"D:\from tosh\" col1:=B> dupe:size;!col1
harryray2
Posts: 1104
Joined: Sat Oct 15, 2016 9:56 am

Re: Duplicates in two directories

Post by harryray2 »

Thanks, that's less complicated. I'll use it as a template.
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Duplicates in two directories

Post by raccoon »

void wrote: Tue Nov 22, 2022 10:47 am I am looking into easier ways to "mark" files.
Do you mean like Checkbox Select, as Windows Explorer offers?
harryray2
Posts: 1104
Joined: Sat Oct 15, 2016 9:56 am

Re: Duplicates in two directories

Post by harryray2 »

I also meant to ask what's meant by "mark files".

David's solution does help in the short term, but I do think I do think an easy solution is needed, as it's very difficult trying to sort out the duplicates within a directory that has multiple sub-directories.
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Duplicates in two directories

Post by raccoon »

On second thought, he may be referring to the context as given by other de-dupe software, like DupeGuru. Marking files as in choosing the context(s) in which files are marked or excluded for deletion, pending final review. These context scenarios make it easier to select which files are to be deleted, without tediously going through them one-by-one, but based on pre-defined categories and filters.
void
Developer
Posts: 16743
Joined: Fri Oct 16, 2009 11:31 pm

Re: Duplicates in two directories

Post by void »

I was exploring a "Mark" property.

When the mark column is shown, you can right click files and click Set Mark.

You can set the mark to any text.

The mark lasts until you close the search window.


The idea was to:
Search for "D:\from tosh\"
Select all files
Right click -> Set Mark
Set the mark to: A
Search for "D:\from tosh\backup of d\"
Select all files
Right click -> Set Mark
Set the mark to: B
Search for:
mark: dupe:size;!mark



The following is still easier:
<"D:\from tosh\backup of d\" col1:=A> | <"D:\from tosh\" col1:=B> dupe:size;!col1



A "Mark" property might still be useful, so I'll keep it on my TODO list for now..



I have on my TODO list to add a compare folders feature.
Post Reply