Page 3 of 3

Re: Replacing duplicates with hard links

Posted: 20 Jul 2021 10:30
by highend
oO

Finally, this one:

Code: Select all

text regexmatches(get("Status", 1), "[\x31-\x39][\x30-\x39\x20]*", "|");

Re: Replacing duplicates with hard links

Posted: 20 Jul 2021 11:07
by zakoul

Code: Select all

8|227 |3|602 

Re: Replacing duplicates with hard links

Posted: 20 Jul 2021 12:11
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.

Re: Replacing duplicates with hard links

Posted: 20 Jul 2021 12:17
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

Re: Replacing duplicates with hard links

Posted: 20 Jul 2021 12:22
by zakoul
3602 !!!!
highend, Thank you !!! The script works !!!

Re: Replacing duplicates with hard links

Posted: 20 Jul 2021 12:40
by highend
The full (and again enhanced) script is in the first post...

Re: Replacing duplicates with hard links

Posted: 20 Jul 2021 13:25
by admin
Cool thread! :tup:

Re: Replacing duplicates with hard links

Posted: 20 Jul 2021 14:22
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?

Re: Replacing duplicates with hard links

Posted: 20 Jul 2021 14:41
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)

Re: Replacing duplicates with hard links

Posted: 20 Jul 2021 15:11
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.

Re: Replacing duplicates with hard links

Posted: 22 Jul 2021 10:27
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

Re: Replacing duplicates with hard links

Posted: 22 Jul 2021 12:50
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

Re: Replacing duplicates with hard links

Posted: 22 Jul 2021 13:08
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+?:\|");

Re: Replacing duplicates with hard links

Posted: 22 Jul 2021 13:41
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 !!!