Page 1 of 1

Automatic Selection of File Duplicates

Posted: 21 Nov 2014 08:24
by aimy
Hi all.

I need some help here.

I have some synchronization problems with my cloud service, SugarSync. I have emailed them regarding this issue but they said it is beyond their control since they advised not to sync program files throughout cloud.

With this limitation, thus I have several backup files done by SugarSync whenever they detected file locking of that file (means two or my devices are accessing the file at that time).

For example, for a simple file fsc,db, it generates 14 other copies on my computer:

Code: Select all

D:\SugarSync\Programs\FastStone Capture\fsc.db
D:\SugarSync\Programs\FastStone Capture\fsc (from S13018-NB01 - 5).db
D:\SugarSync\Programs\FastStone Capture\fsc (from Aimy - 8).db
D:\SugarSync\Programs\FastStone Capture\fsc (from S13018-NB01 - 4).db
D:\SugarSync\Programs\FastStone Capture\fsc (from S13018-NB01 - 3).db
D:\SugarSync\Programs\FastStone Capture\fsc (from Aimy - 9).db
D:\SugarSync\Programs\FastStone Capture\fsc (from Aimy - 7).db
D:\SugarSync\Programs\FastStone Capture\fsc (from Aimy - 6).db
D:\SugarSync\Programs\FastStone Capture\fsc (from Aimy - 5).db
D:\SugarSync\Programs\FastStone Capture\fsc (from S13018-NB01 - 2).db
D:\SugarSync\Programs\FastStone Capture\fsc (from Aimy - 4).db
D:\SugarSync\Programs\FastStone Capture\fsc (from S13018-NB01).db
D:\SugarSync\Programs\FastStone Capture\fsc (from Aimy - 3).db
D:\SugarSync\Programs\FastStone Capture\fsc (from Aimy - 2).db
D:\SugarSync\Programs\FastStone Capture\fsc (from Aimy).db
The pattern used is

Code: Select all

filename (from %computername%[ - version_number].fileextension)
So, I thought XYplorer scripting advantage might help in this case whereby I want to keep only the latest file ONLY IF the FILESIZE if BIGGER, delete others.

Is is possible to achieve this? The duplicates will exist in various location however.

Thanks in advanced for the help.

Re: Automatic Selection of File Duplicates

Posted: 24 Nov 2014 03:29
by aimy
Is this impossible to achieve? :(

Thanks.

Re: Automatic Selection of File Duplicates

Posted: 24 Nov 2014 09:13
by highend
Is this impossible to achieve?
Nope.

Take the <curname> from the selected item.
If it doesn't contain " (from " take it as the original name, otherwise strip those parts.
Write a search template which searches for this name + that name with " (from " added (in whatever location) and load it.
Much faster than a folderreport...

A foreach loop that checks date and filesize for each found file and compare them in the loop...

Re: Automatic Selection of File Duplicates

Posted: 18 Jun 2015 04:20
by aimy
Thanks highend.

Any draft sample of code would be much appreciated.

Thank you.

Re: Automatic Selection of File Duplicates

Posted: 18 Jun 2015 10:05
by RalphM
Wow, >6 months for an answer...and then asking for a draft code sample?!?

Re: Automatic Selection of File Duplicates

Posted: 18 Jun 2015 10:19
by highend

Code: Select all

<draft>
<use search function>
...computing
result: quite a few "compare files / folders" scripts have been written
...end

Re: Automatic Selection of File Duplicates

Posted: 19 Jun 2015 12:32
by admin
:biggrin: :titter: