Copy tags from XYplorer 12.90 to 15.20

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
whatever61
Posts: 4
Joined: 12 Jul 2015 21:17

Copy tags from XYplorer 12.90 to 15.20

Post by whatever61 »

I was using an old version of XYPlorer 12 on another PC.

I have lots of tags assigned to different files.

I need to move the list of TAGGED ITEMS (including the tags) to another XYplorer which is 15.20.

I opened the TAGGED ITEMS screen => clicked on the pencil in the left bottom corner => Copied everything and pasted it into the new XYplorer. But when I close that screen and reopen it, this screen becomes empty.

Tried to do the same directly through the file TAG.DAT, doesn't work neither..

Thanks

highend
Posts: 14953
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Copy tags from XYplorer 12.90 to 15.20

Post by highend »

Your problem is: the tag.dat dabatase was changed (from v2 to v3)
Your v12 XY uses the old format.

Use the index in the xy help file (.chm), search for tag.dat. It explains the differences
One of my scripts helped you out? Please donate via Paypal

highend
Posts: 14953
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Copy tags from XYplorer 12.90 to 15.20

Post by highend »

This is a short converter script (from v2 to v3):
Edit the variables "$v2File" and "$v3File" in the script!

Does it work?

Code: Select all

    $v3Header = <<<>>>
XYplorer File Tags v3

Labels:
Red||FC7268;Orange||F6AB46;Yellow||EFDC4A;Green||B5D74A;Blue||5DA4FE;Purple||E29CDC;Grey||B5B5B5

Extra Tags:
URL|6|0|0|||||
|0|0|0|||||
|0|0|0|||||
|0|0|0|||||
|0|0|0|||||

Data:
>>>;

    $v2File = "D:\Users\Highend\Downloads\xyplorer_12.80_beta_noinstall\Data\tag.dat";
    $v3File = "D:\Users\Highend\Downloads\tag.dat";

    $v2Tags = readfile($v2File);
    // Convert
    $convertedTags = "";
    foreach($tag, $v2Tags, "<crlf>") {
        if !(regexmatches($tag, "^(\?:|[A-Z]:|\\\\)")) { continue; }
        $base = regexmatches($tag, "^.+\|\d+\|.+?\|");
        $convertedTags = $convertedTags . $base . "|||||" . gettoken($tag, 7, "|") . "<crlf>";
    }
    $convertedTags = formatlist($convertedTags, "ec", "<crlf>");
    writefile($v3File, "$v3Header<crlf>$convertedTags");
One of my scripts helped you out? Please donate via Paypal

whatever61
Posts: 4
Joined: 12 Jul 2015 21:17

Re: Copy tags from XYplorer 12.90 to 15.20

Post by whatever61 »

highend wrote:This is a short converter script (from v2 to v3):
Edit the variables "$v2File" and "$v3File" in the script!

Does it work?

Code: Select all

    $v3Header = <<<>>>
XYplorer File Tags v3

Labels:
Red||FC7268;Orange||F6AB46;Yellow||EFDC4A;Green||B5D74A;Blue||5DA4FE;Purple||E29CDC;Grey||B5B5B5

Extra Tags:
URL|6|0|0|||||
|0|0|0|||||
|0|0|0|||||
|0|0|0|||||
|0|0|0|||||

Data:
>>>;

    $v2File = "D:\Users\Highend\Downloads\xyplorer_12.80_beta_noinstall\Data\tag.dat";
    $v3File = "D:\Users\Highend\Downloads\tag.dat";

    $v2Tags = readfile($v2File);
    // Convert
    $convertedTags = "";
    foreach($tag, $v2Tags, "<crlf>") {
        if !(regexmatches($tag, "^(\?:|[A-Z]:|\\\\)")) { continue; }
        $base = regexmatches($tag, "^.+\|\d+\|.+?\|");
        $convertedTags = $convertedTags . $base . "|||||" . gettoken($tag, 7, "|") . "<crlf>";
    }
    $convertedTags = formatlist($convertedTags, "ec", "<crlf>");
    writefile($v3File, "$v3Header<crlf>$convertedTags");
Thanks, I ran it, but nothing happened.. no changes in the tag.dat file and no error neither..

whatever61
Posts: 4
Joined: 12 Jul 2015 21:17

Re: Copy tags from XYplorer 12.90 to 15.20

Post by whatever61 »

highend wrote:This is a short converter script (from v2 to v3):
Edit the variables "$v2File" and "$v3File" in the script!

Does it work?

Code: Select all

    $v3Header = <<<>>>
XYplorer File Tags v3

Labels:
Red||FC7268;Orange||F6AB46;Yellow||EFDC4A;Green||B5D74A;Blue||5DA4FE;Purple||E29CDC;Grey||B5B5B5

Extra Tags:
URL|6|0|0|||||
|0|0|0|||||
|0|0|0|||||
|0|0|0|||||
|0|0|0|||||

Data:
>>>;

    $v2File = "D:\Users\Highend\Downloads\xyplorer_12.80_beta_noinstall\Data\tag.dat";
    $v3File = "D:\Users\Highend\Downloads\tag.dat";

    $v2Tags = readfile($v2File);
    // Convert
    $convertedTags = "";
    foreach($tag, $v2Tags, "<crlf>") {
        if !(regexmatches($tag, "^(\?:|[A-Z]:|\\\\)")) { continue; }
        $base = regexmatches($tag, "^.+\|\d+\|.+?\|");
        $convertedTags = $convertedTags . $base . "|||||" . gettoken($tag, 7, "|") . "<crlf>";
    }
    $convertedTags = formatlist($convertedTags, "ec", "<crlf>");
    writefile($v3File, "$v3Header<crlf>$convertedTags");
Thanks, I ran it, but nothing happened.. no changes in the tag.dat file and no error neither..

whatever61
Posts: 4
Joined: 12 Jul 2015 21:17

Re: Copy tags from XYplorer 12.90 to 15.20

Post by whatever61 »

I fixed it. Just needed to add two extra || in the end

highend
Posts: 14953
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Copy tags from XYplorer 12.90 to 15.20

Post by highend »

Thanks, I ran it, but nothing happened.. no changes in the tag.dat file and no error neither..
Show me the two paths that you used for $v2File & $v3File.
One of my scripts helped you out? Please donate via Paypal

Post Reply