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 08-31-2012, 05:20 PM   #1
Iocane
Junior Member
Iocane can extract oil from cheeseIocane can extract oil from cheeseIocane can extract oil from cheeseIocane can extract oil from cheeseIocane can extract oil from cheeseIocane can extract oil from cheeseIocane can extract oil from cheeseIocane can extract oil from cheeseIocane can extract oil from cheese
 
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!)
Iocane is offline   Reply With Quote
Old 09-01-2012, 04:42 AM   #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: 11,734
Karma: 6690881
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.
chaley is offline   Reply With Quote
Advert
Old 09-01-2012, 05:42 AM   #3
Iocane
Junior Member
Iocane can extract oil from cheeseIocane can extract oil from cheeseIocane can extract oil from cheeseIocane can extract oil from cheeseIocane can extract oil from cheeseIocane can extract oil from cheeseIocane can extract oil from cheeseIocane can extract oil from cheeseIocane can extract oil from cheese
 
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
Iocane is offline   Reply With Quote
Old 09-10-2012, 12:40 PM   #4
Man Eating Duck
Addict
Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.
 
Posts: 254
Karma: 69786
Join Date: May 2006
Location: Oslo, Norway
Device: Kobo Aura, Sony PRS-650
Quote:
Originally Posted by chaley View Post
I am not currently in a position to write the template for you. Perhaps someone else can help out, should you need it.
Here:
Code:
{#pages:'first_non_empty(
 cmp($, 10, 'Tiny', '', '')
,cmp($, 25, 'Short', '', '')
,cmp($, 100, 'Medium', '', '')
,cmp($, 300, 'Long', 'Brick', 'Brick')
)'}
Just paste this into the template field in Columns built from other colums (line breaks are removed, but makes changes easier prior to pasting).
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.
Man Eating Duck is offline   Reply With Quote
Reply


Forum Jump

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


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


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