Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 10-30-2015, 07:09 PM   #1
Awfki
Member
Awfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and grace
 
Awfki's Avatar
 
Posts: 24
Karma: 43434
Join Date: Apr 2010
Device: Moon+ Reader (ePub)
Is there a way to merge tags, preferably via regex?

I've started keeping info on awards in tags and initially was keeping the year and category in separate tags but now I've decided I'd rather keep one tag.

Here's an example of the tags I have:

Code:
Hugo2015, HugoNovel
I'd like to turn that into:

Code:
Hugo-2015-Novel
If could work on the string "Hugo2015, HugoNovel" I'd be done already but Calibre seems to only let me work on these two strings separately, "Hugo2015" and "HugoNovel" and so I can't combine them with a regex.

Is there a simple-ish solution?


PS. I know about custom columns but don't wish to use them.

PPS. If there's a simple way to merge tags so I'd end up with "Hugo2015-HugoNovel" or even "Hugo2015HugoNovel" then that would be fine and I can regex from there.

Last edited by Awfki; 10-30-2015 at 07:12 PM.
Awfki is offline   Reply With Quote
Old 10-30-2015, 08:16 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,913
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Understand that Tags that are separated (visually) by commas in the information panel or details are really separate (relational) Records in the linked books-Tags-lnk (table). at this location, they are index integers to the Tags (description) Table


You might be able to do some Native SQL stuff, but the risk is there

I sort of like your original tags
show me Hugo Novels (any)
Hugo Novels And Hugo<year>
Hugo<year> (all types)
theducks is offline   Reply With Quote
Advert
Old 10-31-2015, 06:04 AM   #3
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,339
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
@Awfki: Assuming you are using calibre's bulk metadata search and replace, use {template} as the search field, {tags} as the template, and tags as the destination field. You can then process all the tags as a single string.
chaley is offline   Reply With Quote
Old 10-31-2015, 08:25 AM   #4
goldilocks
Addict
goldilocks ought to be getting tired of karma fortunes by now.goldilocks ought to be getting tired of karma fortunes by now.goldilocks ought to be getting tired of karma fortunes by now.goldilocks ought to be getting tired of karma fortunes by now.goldilocks ought to be getting tired of karma fortunes by now.goldilocks ought to be getting tired of karma fortunes by now.goldilocks ought to be getting tired of karma fortunes by now.goldilocks ought to be getting tired of karma fortunes by now.goldilocks ought to be getting tired of karma fortunes by now.goldilocks ought to be getting tired of karma fortunes by now.goldilocks ought to be getting tired of karma fortunes by now.
 
Posts: 344
Karma: 1222222
Join Date: Aug 2009
Location: Florida
Device: Sony PRS-505
I would just select all the books you want to change the tags on, then select edit metadata (for all the books). There is a selection "Add Tags" - put your new Tag (Hugo-2015-Novel) in the box. Then go to the selection "Remove Tags" and select the tags (Hugo2015, HugoNovel) you want to remove.

Try it on a few to see how it works for you.
goldilocks is offline   Reply With Quote
Old 10-31-2015, 03:25 PM   #5
Awfki
Member
Awfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and grace
 
Awfki's Avatar
 
Posts: 24
Karma: 43434
Join Date: Apr 2010
Device: Moon+ Reader (ePub)
Smile

Quote:
Originally Posted by chaley View Post
@Awfki: Assuming you are using calibre's bulk metadata search and replace, use {template} as the search field, {tags} as the template, and tags as the destination field. You can then process all the tags as a single string.
Excellent! This seems to do just what I wanted.

Now have I'll have to RTFM and figure out what else {template} is good for.

Thanks
Awfki is offline   Reply With Quote
Advert
Old 10-31-2015, 03:29 PM   #6
Awfki
Member
Awfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and grace
 
Awfki's Avatar
 
Posts: 24
Karma: 43434
Join Date: Apr 2010
Device: Moon+ Reader (ePub)
Quote:
Originally Posted by theducks View Post
You might be able to do some Native SQL stuff, but the risk is there

I sort of like your original tags
show me Hugo Novels (any)
Hugo Novels And Hugo<year>
Hugo<year> (all types)
I was thinking about SQL as well but I'm not very comfy with that and blowing up the DB seems like a bad plan (even though there are four copies in the house and one in the cloud).

That was the idea of those tags but each reputation of "Hugo" took a little more space in the tag column. I prefaced my Hugo-2015-Novel-Winner tag with zz t push it to the end and I can still do the various searches, I just have to break out the regex and any excuse to practice with those is a good one.
Awfki is offline   Reply With Quote
Old 10-31-2015, 03:30 PM   #7
Awfki
Member
Awfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and graceAwfki herds cats with both ease and grace
 
Awfki's Avatar
 
Posts: 24
Karma: 43434
Join Date: Apr 2010
Device: Moon+ Reader (ePub)
Quote:
Originally Posted by goldilocks View Post
I would just select all the books you want to change the tags on, then select edit metadata (for all the books). There is a selection "Add Tags" - put your new Tag (Hugo-2015-Novel) in the box. Then go to the selection "Remove Tags" and select the tags (Hugo2015, HugoNovel) you want to remove.

Try it on a few to see how it works for you.
This is actually what I did (instead of going to bed like I should have) but I was trying to find a less tedious way of doing things.

As is I've save an example search for next I need something like this.
Awfki is offline   Reply With Quote
Old 10-31-2015, 03:55 PM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,913
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Awfki View Post
Excellent! This seems to do just what I wanted.

Now have I'll have to RTFM and figure out what else {template} is good for.

Thanks
{template type} is used all over Calibre
{Templates} are column lookup names {title} {#mycustomcol}

The neat thing about {template} in S&R is you can use more than one at a time,. Whereas the other choice is limited to a single field(column)
theducks is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Q: Regex Find and Replace delete surrounding tags hidden.platypus Editor 14 06-16-2015 11:16 PM
RegEx to replace only inside certain tags? phossler Editor 6 03-03-2015 08:24 PM
Bulk metadata download and merge tags and select larger cover(s) hiperlink Calibre 2 03-26-2014 03:58 AM
Regex to selectively grab individual tags? Sidetrack Library Management 1 05-02-2012 02:33 AM
How to Merge Tags Canna71 Calibre 5 09-26-2010 08:47 AM


All times are GMT -4. The time now is 10:36 PM.


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