Automatic Selection of File Duplicates

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
aimy
Posts: 181
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: 181
Joined: 26 Feb 2007 15:44

Re: Automatic Selection of File Duplicates

Post by aimy »

Is this impossible to achieve? :(

Thanks.

highend
Posts: 9517
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 or paypal_donate (at) stdmail (dot) de

aimy
Posts: 181
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.

Online
RalphM
Posts: 1428
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: W10 20H2 Home x64 - XY: Current beta - Office 2019 32-bit)

highend
Posts: 9517
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 or paypal_donate (at) stdmail (dot) de

admin
Site Admin
Posts: 49999
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Automatic Selection of File Duplicates

Post by admin »

:biggrin: :titter:
FAQ | XY News RSS | XY Twitter | Stay home! 🎸 Or wear a mask! 😷

Post Reply