Quantcast
Channel: MobileRead Forums
Viewing all articles
Browse latest Browse all 46912

RegEx for Series - Series No - Title

$
0
0
Hello all,

So due to an amazing catastrophe I lost all my Calibre library and books. I had though at one point saved all the books I had in my Kindle to an external drive when I first got it. So I had those, but all the titles were in the below format

Series - Series Index - Title.mobi with no author

When I start to add them to Calibre again they would import with all the above info under the title and the authors name does appear, so I am assuming it's their metadata that does the trick.

What I would like to achieve is to get all the info on the file name under the right columns and also get the author. I've tried several RegEx and although most of them test perfectly fine, when I do try to import the books the RegEx seem to have no effect. (I have unchecked the Read metadata from file contents rather than file name)

This is the latest one I have been using

(?P<series>[^_0-9-]*) - (?P<series_index>[0-9]*)\s* - \s*(?P<title>[^_].+) ?

and works fine when testing it with

Game of Thrones - 01 - A Game Of Thrones.mobi

Title: A game of Thrones
Authors: Unknown
Series: Game of Thrones
Series Index: 1.0

But when I actually try to add the book I get

Title: Game of Thrones - 01 - A Game Of Thrones.mobi
Authors: George R. R. Martin
Series: Unknown
Series Index: Unknown

Not sure what is wrong but I hope someone can help. I could do it manually but they are about 1200 books. Is it perhaps the fact that they were exported from the Kindle? Does their metadata somehow overide everything else regardless?

Thanks

E :blink:

Viewing all articles
Browse latest Browse all 46912

Trending Articles