Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 05-07-2011, 07:01 AM   #1
wn1ytw
Member
wn1ytw began at the beginning.
 
Posts: 24
Karma: 10
Join Date: May 2011
Location: Worcester, MA USA
Device: kindle PW2, PW3 & KV; Kobo Glo HD
Importing expression title 'by' author help?

Concerning Calibe 'regular expressions', I have again run into a dilemma: when trying to use this one importing books

from the manual:
A regular expression that works here would be [a-zA-Z]+: (?P<title>.+) by (?P<author>.+).

the expression seems to work on one test

Academic Viewpoint by James Gunn.txt
Bicentennial Man, The by Isaac Asimov.txt
Breath's a Ware That Will Not Keep by Thomas F. Monteleone.txt
Crowd of Shadows, A by Charles L. Grant.txt
Houston, Houston Do You Read by James Tiptree Jr.txt
In The Bowl by John Varley.txt
Introduction to Nebula Award Stories 12.txt
Tricentennial by Joe Haldeman.txt

but when run against several folders of files it usually misses the author!

Any clues?

scott
wn1ytw is offline   Reply With Quote
Old 05-07-2011, 08:04 AM   #2
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
It's not surprising it doesn't match the author. The expression expects a different file name than you actually have- it looks for one word followed by a colon, which is discarded, followed by "title by author". For your filenames, try something like
Code:
(?P<title>.+?)\sby\s(?P<author>.+?)
Manichean is offline   Reply With Quote
Advert
Old 05-07-2011, 09:16 AM   #3
wn1ytw
Member
wn1ytw began at the beginning.
 
Posts: 24
Karma: 10
Join Date: May 2011
Location: Worcester, MA USA
Device: kindle PW2, PW3 & KV; Kobo Glo HD
When I try that, I get the first letter of the authors name.... I really am having a hard time understanding the various expressions :-)
wn1ytw is offline   Reply With Quote
Old 05-07-2011, 10:52 AM   #4
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Code:
(?P<title>.+)\sby\s(?P<author>.+)
Tested to work. A subtle, but important, difference to the one I posted earlier
Manichean is offline   Reply With Quote
Old 05-08-2011, 05:30 PM   #5
wn1ytw
Member
wn1ytw began at the beginning.
 
Posts: 24
Karma: 10
Join Date: May 2011
Location: Worcester, MA USA
Device: kindle PW2, PW3 & KV; Kobo Glo HD
Thanks!

getting a glimmer of an idea how this works........
wn1ytw is offline   Reply With Quote
Advert
Old 05-08-2011, 06:00 PM   #6
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,689
Karma: 54369090
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 wn1ytw View Post
Thanks!

getting a glimmer of an idea how this works........
the stuff inside the ( ) gets passed on, the \s matches and eats white space, the 'by' matches and gets eaten
theducks is offline   Reply With Quote
Reply

Tags
author, expression, import, title

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing and maintaining title, author AndrewKantor Calibre 19 08-25-2014 04:34 AM
importing PDF with author, title in filename autchirion Library Management 3 02-22-2011 11:46 AM
Reg expression for importing Debby Library Management 2 02-17-2011 11:20 AM
Helping importing books using regular expression askyn Calibre 4 05-08-2010 01:06 AM
regular expression - importing vs testing pbj Calibre 5 02-09-2010 03:02 PM


All times are GMT -4. The time now is 09:22 AM.


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