05-02-2012, 01:34 PM | #1 |
Junior Member
Posts: 4
Karma: 10
Join Date: May 2012
Device: exPDF
|
Import book issue
Hello,
I'm having issues with adding books properly with regular expressions. Heres the filename: Lee Earle - Syzygy - The First Five Volumes.pdf Heres the regular expression: (?P<author>.+) - (?P<title>.+) Author should be "Lee Earle" and title "Syzygy - The First Five Volumes" Issue is Calibre sees author as "Lee Earle - Syzygy" and title as "The First Five Volumes" .... im having that issue with most of my files with two "-" (hyphen) in their filename. What am I doing wrong? Thanks |
05-02-2012, 03:42 PM | #2 |
Grand Sorcerer
Posts: 12,160
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
(?P<author>[^-].+) - (?P<title>.+) should work
This changes the author search to look for a sequence of any characters that are not -'s. I think there are other approaches that should word as well (look for a discussion on Greedy / Lazy pattern matching). |
Advert | |
|
05-02-2012, 04:21 PM | #3 |
Calibre Plugins Developer
Posts: 4,636
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
I would just make your author expression non greedy in case you have a hyphenated author which would fail with PeterT's expression. Just involves adding one character...
i.e. (?P<author>.+?) - (?P<title>.+) |
05-02-2012, 06:41 PM | #4 |
Grand Sorcerer
Posts: 12,160
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
LOL... I just wasn't fully sure on the non greedy....
|
05-03-2012, 01:10 PM | #5 |
Junior Member
Posts: 4
Karma: 10
Join Date: May 2012
Device: exPDF
|
(?P<author>[^-]+) - (?P<title>.+)
Worked like a charm! Thanks for the help |
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Directories and book import | JulioQc | Library Management | 3 | 05-02-2012 12:36 PM |
Import failed Error:404 when attempting to import from Calibre to Stanza | dvond | Apple Devices | 0 | 05-13-2011 03:00 PM |
Import book from Kobo Software Application | langis | Calibre | 1 | 11-18-2010 11:52 AM |
PDF import issue | Duiker | Calibre | 4 | 08-05-2010 08:58 AM |
PDF import bugs with Book Designer | JSWolf | Sony Reader | 5 | 04-26-2007 03:49 PM |