How to copy Tags & Comments from one location to another?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
chumbo
Posts: 243
Joined: 04 Jan 2015 15:20

How to copy Tags & Comments from one location to another?

Post by chumbo »

I have made a whole bunch of changes to where my files are stored due to an SSD failure.
I would like to now reapply the tags & comments I had stored for those files but to their new location.
So in the tag.dat file, it's very easy for me to find the tags&comments I'm interested in as they were all stored in one folder (I searched the folder name and I have 65 entries).

My plan was to simply replace in the tag.dat file, the path to those 65 entries with the new corrected one, then just restart XY.
Is that safe to do, will that work?

Just want to make sure in order not to irreparably mess up my tags! :shock:
Thanks!

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

Re: How to copy Tags & Comments from one location to another?

Post by highend »

Maybe, maybe not. Depends if the tag.dat Data: section is sorted correctly afterwards
One of my scripts helped you out? Please donate via Paypal

chumbo
Posts: 243
Joined: 04 Jan 2015 15:20

Re: How to copy Tags & Comments from one location to another?

Post by chumbo »

Huh....ok. So, how do I make sure? What should I be careful about? Thx!
Is there a better way?

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

Re: How to copy Tags & Comments from one location to another?

Post by highend »

Copy everything into the clipboard and run a sort script over it, paste it back?
copytext formatlist(<clp>, "ec", <crlf>);
One of my scripts helped you out? Please donate via Paypal

chumbo
Posts: 243
Joined: 04 Jan 2015 15:20

Re: How to copy Tags & Comments from one location to another?

Post by chumbo »

Let me make sure I get this right...
(I assume by clipboard, you mean the area in memory where copy/cut operations are stored, right?)

So I....
- copy all the tag.dat content to e.g. a text file
- make the changes as I described previously
- copy that, go to XY and run your script
- close XY, replace the content of the tag.dat with the clipboard

Correct?

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

Re: How to copy Tags & Comments from one location to another?

Post by highend »

No.

you change the paths in the data section of the tag.dat file, select everything (ofc in the data section again^^), CTRL + C, run the script, paste everything back into the data section, save the tag.dat file, restart XY WITHOUT saving settings now...

Or as a full script (you make the changes to your tag.dat before executing it!):

Code: Select all

    $tagFile = "<xydata>\tag.dat";
    $content = readfile($tagFile);
    $header  = gettoken($content, 1, "Data:<crlf>");
    $data    = gettoken($content, 2, "Data:<crlf>");
    end (!$data), "No tag(s) / comment(s) found in the Data: part, aborted!";

    $data = formatlist($data, "ec", <crlf>);
    writefile($tagFile, $header . "Data:<crlf>" . $data, , "tu");
    exit "nr";
or as a GUI way:
Configuration | Information | Tags | Options | Database Check...
2 x OK button inside the message requesters...
One of my scripts helped you out? Please donate via Paypal

chumbo
Posts: 243
Joined: 04 Jan 2015 15:20

Re: How to copy Tags & Comments from one location to another?

Post by chumbo »

(sorry, had been away from the PC for a few days...)

Awesome, thanks so much!
Really kind of you to have taken the time :D

The 2nd script did it for me :appl:

Post Reply