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-02-2012, 01:34 PM   #1
JulioQc
Junior Member
JulioQc began at the beginning.
 
Posts: 4
Karma: 10
Join Date: May 2012
Device: exPDF
Question 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
JulioQc is offline   Reply With Quote
Old 05-02-2012, 03:42 PM   #2
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
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).
PeterT is offline   Reply With Quote
Advert
Old 05-02-2012, 04:21 PM   #3
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
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>.+)
kiwidude is offline   Reply With Quote
Old 05-02-2012, 06:41 PM   #4
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
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....
PeterT is offline   Reply With Quote
Old 05-03-2012, 01:10 PM   #5
JulioQc
Junior Member
JulioQc began at the beginning.
 
Posts: 4
Karma: 10
Join Date: May 2012
Device: exPDF
(?P<author>[^-]+) - (?P<title>.+)

Worked like a charm!

Thanks for the help
JulioQc is offline   Reply With Quote
Advert
Reply


Forum Jump

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


All times are GMT -4. The time now is 09:42 PM.


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