![]() |
#1 |
Member
![]() 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 |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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>.+?) |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() 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 :-)
|
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
Code:
(?P<title>.+)\sby\s(?P<author>.+) ![]() |
![]() |
![]() |
![]() |
#5 |
Member
![]() 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........ |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,891
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
![]() |
![]() |
![]() |
Tags |
author, expression, import, title |
|
![]() |
||||
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 |