Automatic Selection of File Duplicates

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
aimy
Posts: 182
Joined: 26 Feb 2007 15:44

Automatic Selection of File Duplicates

Post 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.

aimy
Posts: 182
Joined: 26 Feb 2007 15:44

Re: Automatic Selection of File Duplicates

Post by aimy »

Is this impossible to achieve? :(

Thanks.

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Automatic Selection of File Duplicates

Post 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...
One of my scripts helped you out? Please donate via Paypal

aimy
Posts: 182
Joined: 26 Feb 2007 15:44

Re: Automatic Selection of File Duplicates

Post by aimy »

Thanks highend.

Any draft sample of code would be much appreciated.

Thank you.

RalphM
Posts: 1935
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: Automatic Selection of File Duplicates

Post by RalphM »

Wow, >6 months for an answer...and then asking for a draft code sample?!?
Ralph :)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Automatic Selection of File Duplicates

Post by highend »

Code: Select all

<draft>
<use search function>
...computing
result: quite a few "compare files / folders" scripts have been written
...end
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60528
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Automatic Selection of File Duplicates

Post by admin »

:biggrin: :titter:

Post Reply