View Single Post
Old 11-05-2012, 06:19 AM   #1
Sinnott
Junior Member
Sinnott began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2011
Device: Archos Android Tablet
Adding books with different filename structures

I'm pretty new to Calibre so please excuse me if this has been answered before. I looked but couldn't find an answer.

I want to import a library that uses this naming convention:

<Author> - <Series> <series number> - <title>

for books that are not part of a series, the files look like this:

<Author> - <title>

Examples:

Stieg Larsson - Millenium 03 - Girl Who Kicked the Hornets' Nest, The.epub
Stephen King - The Dead Zone.epub

Is there a regular expression that will import both types and put the fields where they should be?

After a lot of reading and trying things, I discovered that this expression:

(?P<author>[^_]+) - (?P<series>.+)(?P<series_index> [0-9]+) - (?P<title>.+)

Will work for the first case, but not the second. Any suggestions? There are a lot of books and I'd rather not manually separate them.
Sinnott is offline   Reply With Quote