Page 1 of 1

modify tags.dat file ?

Posted: 15 Jan 2024 12:19
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

Re: modify tags.dat file ?

Posted: 15 Jan 2024 12:32
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^^

Re: modify tags.dat file ?

Posted: 15 Jan 2024 12:50
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 ...