Page 1 of 1

[Solved] merge content from tag.dat

Posted: 04 Aug 2020 20:03
by xen
i have old tag.dat file, and i have edited content of those files to make its path correct
now i want to "append" this content to current tag.dat file

so i tried appending that content to tag.dat file , but the tag not shown
i guess because the order alphabeta after appending was wrong

is there any way to merge them?
(i searched and found some solutions below but it not works

1.script solution :
viewtopic.php?t=11776#p105245
i try pasting one tag in the input box , but the tag still not showed
(i post this into input box)
L:\n\mp4.avi|0|||film||||
it does not work

2.tag load solution cannot be used because i already edit the old tag.dat
viewtopic.php?t=20111#p167338

3.i cannot use "database check solution" viewtopic.php?t=15822#p137748
because it would remove orphans,which i dont want to

any help would be much appreciated
Thanks

Re: [help] merge content from tag.dat

Posted: 04 Aug 2020 20:31
by highend
Scripting?

Load the original tag.dat
Split it on the data: line in a header and main content part
Load and add (ofc the part after data:) the second tag.dat file to the main content part
formatlist() it with "ec" for [format]
Put the original header + the new formatted main content part together and save it as the original tag.dat again
Done...

Re: [help] merge content from tag.dat

Posted: 05 Aug 2020 06:22
by xen
highend wrote: 04 Aug 2020 20:31 Scripting?

Load the original tag.dat
Split it on the data: line in a header and main content part
Load and add (ofc the part after data:) the second tag.dat file to the main content part
formatlist() it with "ec" for [format]
Put the original header + the new formatted main content part together and save it as the original tag.dat again
Done...
hi, thank you for the help
i add the old and new tags into text file and
run this script to reformat ,i view the file and see that the order was correctly ,the new tag appears in the result
i paste the content into data field of tag.dat
but when i open xyplorer ,the tag not show in xy although it included in tag file
i also open tool => list management => tag items to load tags ,but still not works
i close xyplorer and reopen the tag file, the new tag no longer appeared in tag.dat

here is my script

Code: Select all

	$inputdir = "e:\h\ahk\ini\tagmerge.txt";
    $ouputFile = "e:\h\ahk\ini\tagm-result.txt";
    $contenta = readfile($inputdir,,,);
    $strTxt = formatlist( $contenta, "ec" ,"<crlf>");
    writefile($ouputFile, "$strTxt");
any help would be much appreciated

Re: [help] merge content from tag.dat

Posted: 05 Aug 2020 06:27
by xen
i also try clear content of data field and paste only one line ,now the tag.dat has only one tag
J:\test\053886276.png|0||77|OV051||ss||b136
but still not works
here is my tag.dat
https://drive.google.com/file/d/1_uH0V5 ... sp=sharing
any help would be much appreciated

Re: [help] merge content from tag.dat

Posted: 05 Aug 2020 07:50
by highend
Your tag.dat to download is empty (the part after Data:). What do you want me to comment on that?

Upload your old tag.dat (that you want to expand) + the file with the tags you've edited by hand and show a screenshot of a folder that contains files that are in either of these files...

Re: [help] merge content from tag.dat

Posted: 05 Aug 2020 08:44
by xen
highend wrote: 05 Aug 2020 07:50 Your tag.dat to download is empty (the part after Data:). What do you want me to comment on that?

Upload your old tag.dat (that you want to expand) + the file with the tags you've edited by hand and show a screenshot of a folder that contains files that are in either of these files...
Thanks for the help,
sorry i uploaded the wrong files, i have justed reupload the tag.dat i edited by hand (which contains only 1 line in data section ,and here is that line )

Code: Select all

J:\test\053886276.png|0||77|OV051||ss||b136
here is the link
https://drive.google.com/file/d/1_uH0V5 ... u4aLi/view
as you can see (screenshot i attached) when i open the xyplorer , no tag in extra column 2 (the column which i named as "NID"
you can test it by replace that tag.dat in your xyplorer data folder and create a file J:\test\053886276.png and see no tag field in extra column2

Re: [help] merge content from tag.dat

Posted: 05 Aug 2020 08:59
by highend
And you are really wondering why this doesn't work? oO

Replace your entry with: J:\test\053886276.png|0||77|OV051||ss||b136|||||||||||

Re: [help] merge content from tag.dat

Posted: 05 Aug 2020 09:17
by xen
highend wrote: 05 Aug 2020 08:59 And you are really wondering why this doesn't work? oO

Replace your entry with: J:\test\053886276.png|0||77|OV051||ss||b136|||||||||||
thank you very much , now it works
i didnt notice that the tag i want to append has less tag fields (between two "|") than the original one