08-31-2012, 05:20 PM | #1 |
Junior Member
Posts: 8
Karma: 1162
Join Date: Mar 2011
Device: Sony PRS-600
|
Automatically tag based on column info?
The short question is basically what it says in the title. Can Calibre automatically tag, or edit a custom column to a given listing based on information from another column. Not simply copying, which seems to be what "Column built from other columns" is for.
Longer explaination: I use the page count plug ins and I would like to split my books roughly by size. I.e. 10 pages or less, Micro, 10-25 pages, Tiny and so on. I'd like to have a Story Size column that set itself automatically to the size of the story based on the number of pages. So if the Page count column is updated to 17 pages, the Story Size column automatically sets itself to Tiny. Is this at all possible? If so, is it something one of you kindly souls would be willing to talk me through? (I hope this is the right forum, if not, my apologies!) |
09-01-2012, 04:42 AM | #2 |
Grand Sorcerer
Posts: 11,961
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
You can do this with columns built from other columns. You would use a General Program Mode template that returns a different value based on the number of pages. You would use "first_non_empty" and "cmp" to produce the correct values.
I am not currently in a position to write the template for you. Perhaps someone else can help out, should you need it. |
Advert | |
|
09-01-2012, 05:42 AM | #3 |
Junior Member
Posts: 8
Karma: 1162
Join Date: Mar 2011
Device: Sony PRS-600
|
Thanks! I'll have a look at the link when I'm not quite so sleep deprived
|
09-10-2012, 12:40 PM | #4 | |
Addict
Posts: 254
Karma: 69786
Join Date: May 2006
Location: Oslo, Norway
Device: Kobo Aura, Sony PRS-650
|
Quote:
Code:
{#pages:'first_non_empty( cmp($, 10, 'Tiny', '', '') ,cmp($, 25, 'Short', '', '') ,cmp($, 100, 'Medium', '', '') ,cmp($, 300, 'Long', 'Brick', 'Brick') )'} It works by successively comparing number of pages and selecting that value if the number is lower. I suppose you figure out how to change it to suit your preferences You can copy/paste the second to last cmp line if you want more values. |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need help with programming a column based on previous data in the same column | seaquay | Library Management | 2 | 06-13-2012 12:19 PM |
Automatically set custom column when fetching news | bork | Library Management | 1 | 04-14-2012 03:20 AM |
How to automatically populate a tag with the decade from the pubdate via python | smoothrolla | Library Management | 5 | 11-19-2011 06:41 AM |
Automatically add tag if word/phrase found in ebook? | eosrose | Calibre | 3 | 11-16-2011 06:48 AM |
Automatically change titles to contain series info? | HunterZ | Calibre | 8 | 08-15-2010 09:02 PM |