Replacing duplicates with hard links

Features wanted...
highend
Posts: 10571
Joined: 06 Feb 2011 00:33

Re: Replacing duplicates with hard links

Post by highend »

oO

Finally, this one:

Code: Select all

text regexmatches(get("Status", 1), "[\x31-\x39][\x30-\x39\x20]*", "|");
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

zakoul
Posts: 76
Joined: 11 Dec 2019 10:44

Re: Replacing duplicates with hard links

Post by zakoul »

Code: Select all

8|227 |3|602 

zakoul
Posts: 76
Joined: 11 Dec 2019 10:44

Re: Replacing duplicates with hard links

Post by zakoul »

This is what I noticed when I ran text get ("Status", 1).
it uses No-Break Space (U+00A0) instead of the usual space (U+0020)
Image
Maybe this is the problem?

There are no such spaces in your example.
Last edited by zakoul on 20 Jul 2021 12:57, edited 3 times in total.

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

Re: Replacing duplicates with hard links

Post by highend »

Code: Select all

text regexreplace(gettoken(regexmatches(get("Status", 1), "[\x31-\x39][\x30-\x39\xA0\x20]*", "|"), -1, "|"), "(\xA0|\x20)");
Then this should work
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

zakoul
Posts: 76
Joined: 11 Dec 2019 10:44

Re: Replacing duplicates with hard links

Post by zakoul »

3602 !!!!
highend, Thank you !!! The script works !!!

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

Re: Replacing duplicates with hard links

Post by highend »

The full (and again enhanced) script is in the first post...
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

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

Re: Replacing duplicates with hard links

Post by admin »

Cool thread! :tup:
FAQ | XY News RSS | XY Twitter | Stay home! 🎸 Or wear a mask! 😷

zakoul
Posts: 76
Joined: 11 Dec 2019 10:44

Re: Replacing duplicates with hard links

Post by zakoul »

Is it possible to do this using an XYplorer, without creating a baht file, to speed up the process? The XYplorer can create hard links. Or does he use "mklink" for this?

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

Re: Replacing duplicates with hard links

Post by highend »

The XYplorer can create hard links
Only when running with admin privileges, otherwise it'll fail

It wouldn't be that much faster anyway (executing the batch file shouldn't take that long)
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

zakoul
Posts: 76
Joined: 11 Dec 2019 10:44

Re: Replacing duplicates with hard links

Post by zakoul »

In XYplorer, administrator rights are required to create symbolic links. It does not seem to require administrator rights to create hard links.
It takes a long time to create a baht file.
The XYplorer finds duplicate files very quickly. It would be great if he also quickly replaced them with hard links.

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

Re: Replacing duplicates with hard links

Post by highend »

This is the fastest way:

01. Change the name of your dupe column in the script
02. Change the path to the "XY_Dupe hardlink creator_x64.exe" in the script

The .exe file will create an .ini file in the same folder on the first run
You can change the values for
ShowConfirmation=1
ShowLogInNotepad=1

afterwards if you want to... https://www.dropbox.com/s/qkilot4tv0ayf ... 4.exe?dl=0
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

zakoul
Posts: 76
Joined: 11 Dec 2019 10:44

Re: Replacing duplicates with hard links

Post by zakoul »

Code: Select all

    // Change this to the name of the column in your language if necessary
    $dupeColumnName = "Dupes";

    // Change the path to "XY_Dupe hardlink creator_x64.exe"
    $tool = "<xydata>\Utils\XY_Dupe hardlink creator_x64.exe";
Image
Result:
Image

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

Re: Replacing duplicates with hard links

Post by highend »

Replace

Code: Select all

$layout = regexmatches($view, "^\d+?\|\d+?:\|.+?\\\|"); // Does check until name column but not including it
with

Code: Select all

$layout = regexmatches($view, "^\d+?\|\d+?:\|");
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

zakoul
Posts: 76
Joined: 11 Dec 2019 10:44

Re: Replacing duplicates with hard links

Post by zakoul »

I can not believe this !!!
30763 files, 30290 duplicates, 12440 groups, 17852 hard links. Through the baht file, the process lasted 33 minutes. Through XY_Dupe hardlink creator - 15 seconds.
XYplorer has the fastest way to find and replace files with hard links !!! Thank you !!!
Attachments
Replace duplicates with hardlink Ru.zip
(46.43 KiB) Downloaded 6 times

Post Reply