Replacing duplicates with hard links

Features wanted...
zakoul
Posts: 130
Joined: 11 Dec 2019 10:44

Re: Replacing duplicates with hard links

Post by zakoul »

Yes. With 1526 duplicates everything works fine.
Thank you !!!

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

Re: Replacing duplicates with hard links

Post by zakoul »

Checked on another folder.
result text get("Status", 1)

Code: Select all

найдено: 8 227 дублей в 3 602 группах
Result text trim(gettoken(regexmatches(get("Status", 1), "\b[0-9 ]+\b", "|"), -1, "|"))

Code: Select all

602
Instead of 3602

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

Re: Replacing duplicates with hard links

Post by highend »

Code: Select all

    $txt = "найдено: 8 227 дублей в 3 602 группах";
    text trim(gettoken(regexmatches($txt, "\b[0-9 ]+\b", "|"), -1, "|"));
Outputs "3 602", but not "602"?

Try this:

Code: Select all

$cntAllGroups = replace(gettoken(regexmatches(get("Status", 1), "\b[1-9][0-9 ]*\b", "|"), -1, "|"), " ");
which will remove all spaces
One of my scripts helped you out? Please donate via Paypal

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

Re: Replacing duplicates with hard links

Post by zakoul »

Not in Find (duplicates) mode, aborted!

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

Re: Replacing duplicates with hard links

Post by highend »

You did forget to change $dupeColumnName = "Dupes";...
One of my scripts helped you out? Please donate via Paypal

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

Re: Replacing duplicates with hard links

Post by zakoul »

I'm confused. need to rest.

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

Re: Replacing duplicates with hard links

Post by zakoul »

Hello. Checked the option with "replace(gettoken(regexmatches(get("Status", 1), "\b[1-9][0-9 ]*\b", "|"), -1, "|"), " ")"
Result 602.
And there is one more problem. A hard link is not created if the name contains an accent mark (U+00B4)

Code: Select all

80´s Movies
The deletion works but the Hard Link is not created.

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

Re: Replacing duplicates with hard links

Post by highend »

Code: Select all

    $txt = "найдено: 8 227 дублей в 3 602 группах";
    echo replace(gettoken(regexmatches($txt, "\b[1-9][0-9 ]*\b", "|"), -1, "|"), " ");
1.png
1.png (3.13 KiB) Viewed 799 times
2.png
2.png (3.6 KiB) Viewed 799 times
Maybe check your code page / font in your console?
Or try to switch the codepage by adding a @CHCP 65001 to the beginning of $batHeader...
One of my scripts helped you out? Please donate via Paypal

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

Re: Replacing duplicates with hard links

Post by zakoul »

chcp 65001 solved the problem, now hard links are being created.
Did I insert chcp 65001 correctly?

Code: Select all

        $batHeader = <<<>>>
chcp 65001
@ECHO OFF
REG QUERY "HKU\S-1-5-19" >NUL 2>NUL && GOTO :ENDUAC
SET "vbsFile=%TEMP%\~getAdmin.vbs"
IF "%1" NEQ "" (FOR /F "tokens=*" %%I IN ('ECHO %*') DO SET "param=%%~I")

ECHO Set UAC = CreateObject^("Shell.Application"^)> "%vbsFile%"
ECHO UAC.ShellExecute "cmd", "/c """"%~s0"" ""%param%""""", "", "runas", ^1>> "%vbsFile%"
CSCRIPT "%vbsFile%" //Nologo
IF EXIST "%vbsFile%" DEL /Q "%vbsFile%" >NUL 2>NUL
EXIT /B
:ENDUAC
        >>>;
Result echo replace(gettoken(regexmatches(get("Status", 1), "\b[1-9][0-9 ]*\b", "|"), -1, "|"), " ")
Image

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

Re: Replacing duplicates with hard links

Post by highend »

Did I insert chcp 65001 correctly?
Yeah

Show these two:
echo get("Status", 1)
echo regexmatches(get("Status", 1), "\b[1-9][0-9 ]*\b", "|");
One of my scripts helped you out? Please donate via Paypal

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

Re: Replacing duplicates with hard links

Post by zakoul »

Image
Image

It depends on the language. Like this in English:
Image

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

Re: Replacing duplicates with hard links

Post by highend »

echo regexmatches(get("Status", 1), "[1-9][0-9 ]*", "|");
What does this show?
One of my scripts helped you out? Please donate via Paypal

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

Re: Replacing duplicates with hard links

Post by zakoul »

Code: Select all

8|227 |3|602 

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

Re: Replacing duplicates with hard links

Post by highend »

That doesn't make sense at all...

Last try:

Code: Select all

text replace(regexreplace(get("Status", 1), "^([^0-9]+?)([0-9 ]+)([^0-9]+?)([0-9 ]+)([^0-9]+?)$", "$4"), " ");
One of my scripts helped you out? Please donate via Paypal

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

Re: Replacing duplicates with hard links

Post by zakoul »

Code: Select all

найдено:8 227дублейв3 602группах

Post Reply