Page 1 of 1

can i export tags and labels ?

Posted: 13 Dec 2017 18:08
by giuliastar
Hi
well i have xyplorer installed on my dekstop w10 and laptop w7 both 64bit

and i have a portable version on my external usb3 stick and portable hard disk usb3

can i export tags and labels for example from the portable version to another portable version or installation version?

in short can i export tags and labels from my xyplorer portable (i use at work) to my w10 pro installation version ?

thanks

Re: can i export tags and labels ?

Posted: 13 Dec 2017 18:39
by highend
Sure

Code: Select all

rtfm "idh_scripting_comref.htm#idh_sc_tagexport";

Re: can i export tags and labels ?

Posted: 13 Dec 2017 20:53
by giuliastar
highend wrote:Sure

Code: Select all

rtfm "idh_scripting_comref.htm#idh_sc_tagexport";
hi
should i add this command in the XYplorer's addressbar ?


and to import in another seperate xyplorer installation ?

thanks highend

Re: can i export tags and labels ?

Posted: 13 Dec 2017 21:01
by highend
should i add this command in the XYplorer's addressbar ?
After reading the documentation and adding the correct parameters? Yes, the address bar would work
and to import in another seperate xyplorer installation ?
The remarks for that command mention what command you would need there?

Re: can i export tags and labels ?

Posted: 14 Dec 2017 11:36
by giuliastar
highend wrote:
should i add this command in the XYplorer's addressbar ?
After reading the documentation and adding the correct parameters? Yes, the address bar would work
and to import in another seperate xyplorer installation ?
The remarks for that command mention what command you would need there?
hi
everyday i found out how powerful is xyplorer but even how it's complex
for example i want to export all the files tagged with yellow label

if i use tagexport([db], [path], [storage], [flags]) it creates a file from data\tag.dat (including all the tags)

is a good idea open the file tag.dat with notepad++ and copy what i need and paste in the tag.dat on the another xyplorer?
thanks

Re: can i export tags and labels ?

Posted: 14 Dec 2017 12:02
by highend
You never explicitly said that you want to export a subset of items with specific tags / labels...

Possible? Sure, but it requires more scripting
Fastest way?
Look up what e.g. a yellow label is as an integer
regexmatches() the content of the tag.dat file for these items
write the matches into a new file, append the tag.dat header
import that file on another instance via tagload...

There are slower methods (with foreach loops which anybody should avoid if it
comes to a massive amount of possible entries)
if i use tagexport([db], [path], [storage], [flags]) it creates a file from data\tag.dat (including all the tags)
Em, [...] parameters are optional and IF they are used, they should be filled with correct values...
is a good idea open the file tag.dat with notepad++ and copy what i need and paste in the tag.dat on the another xyplorer?
That does not work. Not without bringing these items in the correct sort order (the tag.dat requires this)
Requires scripting as well

A script that can export labels...
Write your own / modify this one to do the same for tags...

Code: Select all

    $labelColor = "yellow";

    $labels = "1;Red|2;Orange|3;Yellow|4;Green|5;Blue|6;Purple|7;Grey";

    // ========================================================================
    // == DO NOT CHANGE ANYTHING BELOW IF YOU DO NOT KNOW WHAT YOU ARE DOING ==
    // ========================================================================

    $pattern = gettoken(gettokenindex($labelColor, $labels, "|"), 1, ";");
    $content = readfile("<xydata>\tag.dat");
    $header  = gettoken($content, 1, "Data:<crlf>");
    $tags    = gettoken($content, 2, "Data:<crlf>");
    $matches = regexmatches($tags, "^[^|]+\|$pattern\|.*(?=\r?\n|$)", <crlf>);
    writefile("<xydata>\exported_tags.dat", $header . "Data:<crlf>$matches");