Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 07-01-2020, 03:25 PM   #1
Rellwood
Library Breeder (She/Her)
Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.
 
Rellwood's Avatar
 
Posts: 1,265
Karma: 1937891
Join Date: Apr 2015
Location: Fullerton, California
Device: Paperwhite 2015 (2), PW 2024 (12 GEN), PW 2023 (11 GEN), Scribe (1st)
creating a tag rule

Through some rule or another I have ended up with a few tags with leading periods. They are multiple word tags that have the period between the words, but they have a leading period. I must have had a rule to delete whatever parent word/tag it was and it left the period (heirarchal shelves)

Since I can't do a search and replace on the period (multiple periods per tag), I was wondering if someone could help me by showing me a quick tag mapper rule or a regex rule that I can use in search replace in edit that would find and delete these leading periods, but retain the others. I have not yet figured out how the rules quite work and the "matches pattern" seems to have me stumped. I can do the keep, remove, split, replace, but "matches pattern" is a toss up for me.

I always thought that it meant that if a certain word was shown anywhere in the tag then it "matched the pattern" and the rule would be applied. It doesn't seem to be that easy. I have looked online and found resources, but (forgive me) I have certain cognitive difficulties that make understanding the terms difficult. I have got a lot of things down pat, but coding and regex, python has always been my Achilles heel.


Please and thank you.
Rellwood is offline   Reply With Quote
Old 07-01-2020, 03:52 PM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,444
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Rellwood View Post
Through some rule or another I have ended up with a few tags with leading periods. They are multiple word tags that have the period between the words, but they have a leading period. I must have had a rule to delete whatever parent word/tag it was and it left the period (heirarchal shelves)

Since I can't do a search and replace on the period (multiple periods per tag) ...
Why not? You can match tags with a leading period with the regexp
Code:
^\.
It isn't clear what you want to do with these tags so I can't go beyond the search pattern.

Depending on how many there are of these you might find it faster to change them in "Manage tags" (right click on Tags in the tag browser)
chaley is offline   Reply With Quote
Advert
Old 07-01-2020, 06:07 PM   #3
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,970
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by Rellwood View Post
I have got a lot of things down pat, but coding and regex, python has always been my Achilles heel.
For future uses, this site was sent to me by another user on here and its explanations often help me untangle the mess of my own regexes:
https://regex101.com/

ownedbycats is online now   Reply With Quote
Old 07-01-2020, 07:41 PM   #4
Rellwood
Library Breeder (She/Her)
Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.
 
Rellwood's Avatar
 
Posts: 1,265
Karma: 1937891
Join Date: Apr 2015
Location: Fullerton, California
Device: Paperwhite 2015 (2), PW 2024 (12 GEN), PW 2023 (11 GEN), Scribe (1st)
Quote:
Originally Posted by ownedbycats View Post
For future uses, this site was sent to me by another user on here and its explanations often help me untangle the mess of my own regexes:
https://regex101.com/

Thanks! I will check it out!
Rellwood is offline   Reply With Quote
Old 07-01-2020, 07:43 PM   #5
Rellwood
Library Breeder (She/Her)
Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.
 
Rellwood's Avatar
 
Posts: 1,265
Karma: 1937891
Join Date: Apr 2015
Location: Fullerton, California
Device: Paperwhite 2015 (2), PW 2024 (12 GEN), PW 2023 (11 GEN), Scribe (1st)
Quote:
Originally Posted by chaley View Post
Why not? You can match tags with a leading period with the regexp
Code:
^\.
It isn't clear what you want to do with these tags so I can't go beyond the search pattern.

Depending on how many there are of these you might find it faster to change them in "Manage tags" (right click on Tags in the tag browser)
There are not a lot of these tags, but enough that I didn't want to go about manually deleting those leading periods. They are simply book tags and nothing else. I have them in heirarchal form and for whatever reason I noticed that was getting some that had dropped the parent tag, leaving only the period.

I didn't want to do anything else but fix them so the period was gone.

Thanks for the code. It was just what I was looking for.
Rellwood is offline   Reply With Quote
Advert
Old 07-01-2020, 07:47 PM   #6
Rellwood
Library Breeder (She/Her)
Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.
 
Rellwood's Avatar
 
Posts: 1,265
Karma: 1937891
Join Date: Apr 2015
Location: Fullerton, California
Device: Paperwhite 2015 (2), PW 2024 (12 GEN), PW 2023 (11 GEN), Scribe (1st)
I have a question about "Manage Tags" is it a way of permanently changing tags, or does it just work on the tags at the given time. I ahve been going about changing and deleting tags and really hope that it isn't permanent. I have used it as a quick way to bulk delete tags that I may want later.

If it is permanent, is there a way of "resetting" it?
Rellwood is offline   Reply With Quote
Old 07-01-2020, 09:15 PM   #7
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,970
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
The tag mapping only apply when you press the OK button. It only applies to the books currently showing in the book list too.

Also they run in the order that they appear in the list. You can use the Test Rules button to make sure it has an expected effect.

Last edited by ownedbycats; 07-01-2020 at 09:23 PM.
ownedbycats is online now   Reply With Quote
Old 07-02-2020, 04:13 AM   #8
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,444
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Rellwood View Post
I have a question about "Manage Tags" is it a way of permanently changing tags, or does it just work on the tags at the given time. I ahve been going about changing and deleting tags and really hope that it isn't permanent. I have used it as a quick way to bulk delete tags that I may want later.

If it is permanent, is there a way of "resetting" it?
I am not sure what you are asking. Manage Tags works on the tags "at the moment", possibly taking into consideration a virtual library. Changes made on that dialog take effect when you press OK, at which point the changes are permanent and cannot be undone short of restoring calibre's database.

Thus, if you delete a tag then it removed from all books in the current virtual library, if there is one and the box is checked. In most cases the tag is gone -- removed from calibre's database. The only time it is not removed is if you are using a virtual library and the tag exists in books not in the VL.
chaley is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ways for the parent tag to not be shown with the child tag in the tags column? icecold Calibre 3 03-16-2020 10:23 PM
html img tag versus svg wrapped image tag hobnail ePub 8 02-27-2020 03:16 AM
Creating Tag Browser Sub-Groups MartyTX Library Management 1 08-06-2012 09:01 PM
Creating a Short Text Column that Doesn't Appear in Tag Browser? shocampo Calibre 2 09-12-2010 01:35 PM
Creating a Library file w/Author, Title, Summary and tag info asktheeightball Calibre 2 01-18-2010 10:28 AM


All times are GMT -4. The time now is 09:23 PM.


MobileRead.com is a privately owned, operated and funded community.