I want to use XYplorer as a library cataloging program

Features wanted...
SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

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

Post 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.
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

highend
Posts: 14571
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

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

Post 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...
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 64917
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

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

Post 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.

Ryan
Posts: 63
Joined: 10 Jul 2015 02:47

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

Post 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?

highend
Posts: 14571
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

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

Post 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.
One of my scripts helped you out? Please donate via Paypal

Ryan
Posts: 63
Joined: 10 Jul 2015 02:47

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

Post 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.

highend
Posts: 14571
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

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

Post 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
One of my scripts helped you out? Please donate via Paypal

Ryan
Posts: 63
Joined: 10 Jul 2015 02:47

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

Post 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:

admin
Site Admin
Posts: 64917
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

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

Post 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.

admin
Site Admin
Posts: 64917
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

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

Post 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!

Ryan
Posts: 63
Joined: 10 Jul 2015 02:47

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

Post 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.

Ryan
Posts: 63
Joined: 10 Jul 2015 02:47

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

Post 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?

admin
Site Admin
Posts: 64917
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

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

Post 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

admin
Site Admin
Posts: 64917
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

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

Post 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.

Ryan
Posts: 63
Joined: 10 Jul 2015 02:47

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

Post 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?

Post Reply