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 05-05-2013, 09:15 AM   #1
Victorious56
Junior Member
Victorious56 began at the beginning.
 
Victorious56's Avatar
 
Posts: 8
Karma: 10
Join Date: May 2013
Location: Berkshire, UK
Device: Marvin for iPad
Metadata Plugboard for Series Number Reformatting

Hello,
As a new Calibre user I have been struggling a little with formatting metadata when saving to disc, specifically the series number.
I would, if possible, like to reformat a series number of 1.00, 2.00 etc to be 1,2 etc with no decimal places shown if they are zero. A series number of 5.10 would convert to 5.1.

I have set up a Metadata Plugboard for the title of

{series:||, Book }{series_index:4.1f|| - }{title}

which gives me titles of

A Song of Ice and Fire, Book 5.1 - A Dance With Dragons, Part 1 - Dreams and Dust
A Song of Ice and Fire, Book 3.0 - A Storm of Swords

Ideally 'Book 3.0' would be changed to 'Book 3', but after much searching I haven't managed to find out if this is possible.
I'd be grateful if any more knowledgeable user could help me
Victorious56 is offline   Reply With Quote
Old 05-05-2013, 11:35 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,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
If none of your series numbers are larger than 5 digits (99999.), then use
Code:
{series_index:g}
where the 'g' stands for 'general'.

If you do have very large indices, then use
Code:
{series_index:re((\.\d)0,\1)}
to strip off any zero after a decimal point and a digit.
chaley is offline   Reply With Quote
Advert
Old 05-06-2013, 06:03 AM   #3
Victorious56
Junior Member
Victorious56 began at the beginning.
 
Victorious56's Avatar
 
Posts: 8
Karma: 10
Join Date: May 2013
Location: Berkshire, UK
Device: Marvin for iPad
Thank you chaley, using your first suggestion worked perfectly
Do you know of an online resource which has a list of these formatting options?
Thank you again!
Victorious56 is offline   Reply With Quote
Old 05-06-2013, 06:48 AM   #4
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by Victorious56 View Post
Do you know of an online resource which has a list of these formatting options?
This section of the calibre manual outlines the template language and points you to the Python documentation for advanced formatting options.

Last edited by DoctorOhh; 05-06-2013 at 06:50 AM.
DoctorOhh is offline   Reply With Quote
Old 05-08-2013, 05:09 AM   #5
Victorious56
Junior Member
Victorious56 began at the beginning.
 
Victorious56's Avatar
 
Posts: 8
Karma: 10
Join Date: May 2013
Location: Berkshire, UK
Device: Marvin for iPad
^ Thanks for those. I did have a quick look previously, but I think I need to spend a bit more time on this. I used to be a Cobol programmer but Python is very different
Victorious56 is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugboard "Metadata: Show series [series index] - title as title (Kindle)" Deep Cover Library Management 6 11-30-2012 05:17 PM
Metadata - get number out of Author and in Series anvarit Library Management 9 10-12-2012 08:20 AM
Add book number in a series to metadata? EtrnLwanderer Sigil 6 03-10-2012 01:48 PM
Series sorting in plugboard ac4lt Devices 6 01-13-2012 12:53 PM
Metadata Plugboard - First Char of each word in Series MikeP1212 Calibre 2 10-14-2010 06:14 PM


All times are GMT -4. The time now is 12:18 AM.


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