![]() |
#1 |
Library Breeder (She/Her)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#2 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,444
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
^\. 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) |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,970
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Quote:
https://regex101.com/ ![]() |
|
![]() |
![]() |
![]() |
#4 | |
Library Breeder (She/Her)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
![]() |
|
![]() |
![]() |
![]() |
#5 | |
Library Breeder (She/Her)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
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. ![]() |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Library Breeder (She/Her)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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? |
![]() |
![]() |
![]() |
#7 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#8 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,444
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
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. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |