modify tags.dat file ?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
bossi
Posts: 24
Joined: 30 Jul 2022 11:09

modify tags.dat file ?

Post by bossi »

hi @ all , so in my workflow id like to read tags data via python and act on it .

Code: Select all

file = locally exported tags file .dat
file.read().decode('utf-16le')
reads the .dat file and the content can be processed further.

the problem is when i edit a tag and save it to an modified.dat file :

Code: Select all

file_modified.write(updated_content.encode('utf-16le'))
"import local tags" does not work for it ...

I hope i can directly write to the main tags.dat file somehow...

as of now , it seems i would need to write to a separate .txt file the PATH + TAG and use xy-script to import&update the tags

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

Re: modify tags.dat file ?

Post by highend »

And now we have to guess how the modified tag.dat file looks?

Create example tag.dat files, that only contain 3 tagged files and allow to test this case

Attach the original tag.dat and the modified one (both renamed to .ini, not .dat)
The full files^^
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

bossi
Posts: 24
Joined: 30 Jul 2022 11:09

Re: modify tags.dat file ?

Post by bossi »

sorry highend , my bad :oops:
it works now =)

the solution was to use

Code: Select all

updated_content = '\r\n'.join(lines)
instead of

Code: Select all

updated_content = '\n'.join(lines)
to join the lines back together ...

Post Reply