Page 3 of 8

Re: I want to use XYplorer as a library cataloging program

Posted: 29 Jul 2015 09:37
by SkyFrontier
admin wrote: 4) Is there anybody else unhappy with the comma? Of course, I *could* make that configurable/tweakable (rendering your current tag DBs useless junk).
Unhappy? Limited, actually.

Re: I want to use XYplorer as a library cataloging program

Posted: 29 Jul 2015 10:15
by highend
I'll write a converter xD
Done :biggrin:

Code: Select all

    $tagFile = "<xydata>\tag.dat";
    $tagFileContent = readfile($tagFile);
    $tagFileHeader  = gettoken($tagFileContent, 1, "Data:<crlf>");
    $tagFileTags    = gettoken($tagFileContent, 2, "Data:<crlf>");

    $tagFileVer = regexreplace($tagFileContent, "(XYplorer File Tags v)(\d+)", "$2");
    if ($tagFileVer < 3) { status "tag.dat file must be of version 3 (or later), aborted!", "8B4513", "stop"; end 1==1; }

    $delim = input("Convert tag delimiter", "Only single character delimiters are possible.<crlf>'|,<,>,* and ?' are not allowed as a replacement character!", , , , 250, 150);
    if (regexmatches($delim, "(\|<|>|\*|\?)")) { status "$delim is not allowed as a replacement delimiter, aborted!", "8B4513", "stop"; end 1==1; }
    if (strlen($delim) > 1) { status "The delimiter can only be a SINGLE character, aborted!", "8B4513", "stop"; end 1==1; }

    $newTags = "";
    foreach($entry, $tagFileTags, "<crlf>") {
        if !($entry) { continue; }
        $tags = gettoken($entry, 3, "|");
        if ($tags) {
            $newTags = $newTags . regexreplace($entry, "^(.*?\|\d+\|)([^\|]*)(.*(?=$))", "$1" . replace($tags, ",", $delim) . "$3") . "<crlf>";
        } else { $newTags = $newTags . $entry . "<crlf>"; }
    }
    if (confirm("Write the converted tag.dat file back?")) {
        writefile($tagFile, $tagFileHeader . "Data:<crlf>" . $newTags);
    }
The check for not allowed delimiters can easily be enhanced...

Re: I want to use XYplorer as a library cataloging program

Posted: 29 Jul 2015 10:29
by admin
Cool. I will add the option to 15.50.0100. If it is in Configuration (not a tweak) then of course I can do the conversion myself just by rewriting the DB.

Re: I want to use XYplorer as a library cataloging program

Posted: 29 Jul 2015 14:08
by Ryan
admin wrote:Cool. I will add the option to 15.50.0100. If it is in Configuration (not a tweak) then of course I can do the conversion myself just by rewriting the DB.
Superb! So if I understand correctly, the script that was posted here can be run in the existing version and then the full option will be implemented in the next release?

Re: I want to use XYplorer as a library cataloging program

Posted: 29 Jul 2015 14:14
by highend
the script that was posted here can be run in the existing version and then the full option will be implemented in the next release?
It makes no sense to convert anything until the real feature isn't implemented. Wait for the next release.

Re: I want to use XYplorer as a library cataloging program

Posted: 29 Jul 2015 14:20
by Ryan
highend wrote:
the script that was posted here can be run in the existing version and then the full option will be implemented in the next release?
It makes no sense to convert anything until the real feature isn't implemented. Wait for the next release.
I hope Don will implement this along with the full wildcard keyword search function.

Re: I want to use XYplorer as a library cataloging program

Posted: 29 Jul 2015 14:22
by highend
I hope Don will implement this
I will add the option to 15.50.0100
along with the full wildcard keyword search function
http://www.xyplorer.com/xyfc/viewtopic.php?f=10&t=14346

Re: I want to use XYplorer as a library cataloging program

Posted: 29 Jul 2015 16:40
by Ryan
Forgive my lack of attention: I had failed to reach each of the previous replies thoroughly. I eagerly await the next release!! :appl:

Re: I want to use XYplorer as a library cataloging program

Posted: 29 Jul 2015 16:46
by admin
Ryan wrote:I hope Don will implement this along with the full wildcard keyword search function.
The "full wildcard keyword search function" as you call it is already implemented in 15.50 as a tweak. You know how to handle tweaks?

Code: Select all

    + Tag Search: Added tweak to allow partial matches in tag search. There are 
      three values:
        
        TagsFindPartialMatch=0      match the whole tag (factory default)
                                    e.g. pattern "rock" matches tag "rock"
        
        TagsFindPartialMatch=1      match any words in tag
                                    e.g. pattern "rock" matches tag "rock and roll"
        
        TagsFindPartialMatch=2      match any part of tag
                                    e.g. pattern "rock" matches tag "rocking" or "sprock"
                                    
      The tweak affects Quick Search as well as Find Files | Tags. It affects 
      only tags, not labels or comments.
      If a pattern has wildcards and there is NO verbatim flag (/v), then the 
      tweak is ignored and matching is done against the present wildcards.

Re: I want to use XYplorer as a library cataloging program

Posted: 29 Jul 2015 17:35
by admin
Ryan wrote:Forgive my lack of attention: I had failed to reach each of the previous replies thoroughly. I eagerly await the next release!! :appl:
I looked into it and found that making the separator configurable might turn out to be madness. Nevertheless I added it as an experimental tweak. Next beta...

Code: Select all

    * Tags: Experimentally added a tweak to customize the separator between the 
      tags of an item. The factory default is , (comma):
      Rules:
        - just one character is allowed, not more
        - but not any of these: <>|*?
      Example:
        TagsSeparator=;
      Notes:
      - If you currently use multiple tags per item they will not be parsed 
        correctly after tweaking the separator.
      - If you share your tags with other users this is the recipe for disaster. 
        Don't even think of using this tweak!

Re: I want to use XYplorer as a library cataloging program

Posted: 29 Jul 2015 18:30
by Ryan
Hi Don,

Have you seen the way WinCatalog2015 handles tags, just by comparison (don't get me wrong--the program is nowhere near XY)? It seems to be able to handle any tag regardless of punctuation.

Again, thank you so much for being so open to suggestions for the development of XY.

Re: I want to use XYplorer as a library cataloging program

Posted: 29 Jul 2015 18:44
by Ryan
admin wrote:
Ryan wrote:I hope Don will implement this along with the full wildcard keyword search function.
The "full wildcard keyword search function" as you call it is already implemented in 15.50 as a tweak. You know how to handle tweaks?

Hi Don - I am assuming it is via the Scripting command?

Re: I want to use XYplorer as a library cataloging program

Posted: 29 Jul 2015 19:08
by admin
Ryan wrote:
admin wrote:
Ryan wrote:I hope Don will implement this along with the full wildcard keyword search function.
The "full wildcard keyword search function" as you call it is already implemented in 15.50 as a tweak. You know how to handle tweaks?

Hi Don - I am assuming it is via the Scripting command?
No. See here: http://www.xyplorer.com/faq-topic.php?id=tweak

Re: I want to use XYplorer as a library cataloging program

Posted: 29 Jul 2015 19:10
by admin
Ryan wrote:Hi Don,

Have you seen the way WinCatalog2015 handles tags, just by comparison (don't get me wrong--the program is nowhere near XY)? It seems to be able to handle any tag regardless of punctuation.

Again, thank you so much for being so open to suggestions for the development of XY.
XY's DB has a simple and open format (this would not be possible of ALL characters are allowed in tags). This is a huge plus over WinCatalog2015 because it's totally independent and future-safe.

Re: I want to use XYplorer as a library cataloging program

Posted: 29 Jul 2015 21:30
by Ryan
admin wrote:
Ryan wrote:
admin wrote:
Ryan wrote:I hope Don will implement this along with the full wildcard keyword search function.
The "full wildcard keyword search function" as you call it is already implemented in 15.50 as a tweak. You know how to handle tweaks?

Hi Don - I am assuming it is via the Scripting command?
No. See here: http://www.xyplorer.com/faq-topic.php?id=tweak
Hi Don - I don't see the $tagfile value in the existing configuration file. Should I just add the tweak code to the beginning or to the ending?