paste new items in tag.dat

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
calude
Posts: 355
Joined: 13 Aug 2008 10:16
Location: Switzerland
Contact:

paste new items in tag.dat

Post by calude »

Hi
I have a set of folders/files that are mirrored between my laptop and desktop
They are tagged on the laptop
I would like to have both mirrors be tagged the same way
yesterday I tried to paste the relevant lines from the laptop's tag.dat to the desktop's tag.dat to no avail.
Tried different ways, in a text editor then reload without save, from the XY edit list interface, but I newer got the new lines imported hence showing the tags

any warnings, experience, help, ideas to try ?

Calude

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

Re: paste new items in tag.dat

Post by highend »

Exact same paths for files?

E.g.:
Desktop - C:\Data\Folder\File1
Laptop - C:\Data\Folder\File1

Did you resort your tag.dat entries on the desktop's tag.dat after importing them?
It needs an ascending binary sort order... otherwise it won't work.
One of my scripts helped you out? Please donate via Paypal

calude
Posts: 355
Joined: 13 Aug 2008 10:16
Location: Switzerland
Contact:

Re: paste new items in tag.dat

Post by calude »

highend wrote:Exact same paths for files?

E.g.:
Desktop - C:\Data\Folder\File1
Laptop - C:\Data\Folder\File1
I had to adjust the beginning of the path in text editor like
Laptop - C:\Data\Folder\File1
Desktop - D:\Other\Data\Folder\File1
double checked, seemed right

highend wrote: Did you resort your tag.dat entries on the desktop's tag.dat after importing them?
It needs an ascending binary sort order... otherwise it won't work.
I saw some old forum post about this but couldnt find " "Database Clean Up..." in Configuration | Tags."
in the current xy version

XY didnt accept/read the "new" tag.dat and kept overwriting the "new" tag.dat with the unedited version

note: the new items contain completely new tags (not apearing in the taglist)

Cal

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

Re: paste new items in tag.dat

Post by highend »

Code: Select all

    $newTags = input("Enter all tags that should be imported...", , , "m", , 800, 500);
    $tagFile = "<xydata>\tag.dat";
    $tagDB = readfile($tagFile);
    $header = gettoken($tagDB, 1, "Data:<crlf>");
    $existingTags = gettoken($tagDB, 2, "Data:<crlf>");
    $newTags = formatlist($existingTags . "<crlf>" . $newTags, "edc", "<crlf>");
    writefile($tagFile, $header . "Data:<crlf>" . $newTags);
Enter all tags from the laptop file into the text box. Hit OK. Quit XY (but ofc you have to DISABLE "General - Startup & Exit - [ ] Save settings on exit FIRST)!
One of my scripts helped you out? Please donate via Paypal

calude
Posts: 355
Joined: 13 Aug 2008 10:16
Location: Switzerland
Contact:

Re: paste new items in tag.dat

Post by calude »

wow thanks :appl: :D

before I try this at my office
is the path correction included here or should it been done before the script does its magic

reread your post I guess the path has already been corrected


Cal

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

Re: paste new items in tag.dat

Post by highend »

path correction? sorry, I don't know which folders you are mirroring so you have to code that yourself.
One of my scripts helped you out? Please donate via Paypal

calude
Posts: 355
Joined: 13 Aug 2008 10:16
Location: Switzerland
Contact:

Re: paste new items in tag.dat

Post by calude »

I just tried your script
no joy yet

the new items got imported to tag.dat fine but the items dont show up in XY
whether in the tag column or in list management window

I compared both tag.dat formats: the laptop one has 2 "|" less than the desktop tag.dat

desktop: (created in desktop for compare)
D:\MUSIC PDF\cours de guitare\Débutants\Accords_a_4_sons.pdf|0|Solo||||||
laptop:
D:\MUSIC PDF\cours de guitare\Débutants\Accords_a_4_sons.pdf|0|exercice, rythm, technique, theory||||

looks like a XY bug...

Cal

calude
Posts: 355
Joined: 13 Aug 2008 10:16
Location: Switzerland
Contact:

Re: paste new items in tag.dat

Post by calude »

highend wrote:path correction? sorry, I don't know which folders you are mirroring so you have to code that yourself.
yes indeed, sorry this post was useless
cal

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

Re: paste new items in tag.dat

Post by highend »

This is no bug.
Tags on the laptop were created by an older XY version. That's all.

Why your entries don't show up?

Give REAL examples.

Two lines (files) from the laptop tag.dat. List them.

The same two lines after importing them on desktop (after they got saved to the tag.dat) file AND a screenshot from XY for these two files in (I want to see the full path). Again (for the file entries): List them.
One of my scripts helped you out? Please donate via Paypal

calude
Posts: 355
Joined: 13 Aug 2008 10:16
Location: Switzerland
Contact:

Re: paste new items in tag.dat

Post by calude »

highend wrote:This is no bug.
Tags on the laptop were created by an older XY version. That's all.
yes
Saved tag.dat this upgraded the DB

everything worked nicely from there

the new tags are alive and kicking in my desktop computer

thanks a lot

next beers are on me :beer: :beer: :beer: :beer: :appl:

Calude

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

Re: paste new items in tag.dat

Post by highend »

Fine :)

and ... thank's for the beers! :beer: :beer: :beer:
One of my scripts helped you out? Please donate via Paypal

Post Reply