View Single Post
Old 06-22-2011, 12:38 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: 29,800
Karma: 54830978
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 akmatov View Post
I'm very new to using Calibre but so far it seems fairly straight forward, but for one small issue.

I have a large number of ebooks I'm entering into Calibre, some of which are part of a series. Looking at the Preferences/Add Book I was able to rearrange the default setting to (?P<author>[^_]+)-(?P<title>.+) so that an ebook file in the format John Smith-A Book.pdf will Add Book into Calibre as Author=John Smith and Title=A Book.

However, what would be the formula for the first book in John Smith's naval mystery series, i.e. "John Smith - A Book - Naval Mystery 1"?

Looking at the preferences that can be set it seems there are quite a few items that could be translated from the file name into Calibre. However, while I was able to figure out "author" and "title", "series" added to the same style of formula didn't work.

Advise would be appreciated.
The default gave the clue.
Code:
^((?P<author>([^\_0-9]+)(?=\s*-\s*)(?!\s*-\s*[0-9.]+)|\b))(\s*-\s*)?((?P<series>[^0-9\-]+) ([-#] ?)?(?P<series_index>[0-9.]+)?\s*-\s*)?(?P<title>.+)
BTW use the 'Test' area to validate the you pattern performs correctly on ALL the files you feed it.
theducks is offline   Reply With Quote