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 06-06-2011, 06:47 PM   #1
Ginnia
Connoisseur
Ginnia began at the beginning.
 
Posts: 51
Karma: 10
Join Date: Jan 2010
Device: Kindle
Adding Books to Calibre error

I've spent hours with this -- PLEASE HELP.

I'm trying to load books to my laptop, and want to create a file of .mobi books. Creating the file is no problem, and I can get it just the way I want it. It's the restoring to my laptop using the Add Books feature that I'm having problems with. Can someone tell me what I need to do to the following Regular Expression to get the "author" portion of the adding process correct? The Test shows the authors separated by a comma (the actual punctuation in Calibre, however is a semi-colon). Neither result in the proper author sort field tho. I want the "&" in the extracted author field so that the author_sort field is correct.

Regular Expression: (?P<title>.+)--(?P<series>.+) (?P<series_index>.+) - - (?P<author>[^_]+)

Test data: Archimedes Effect, The--Net Force 10 - - Tom Clancy & Steve Pieczenik.mobi

Test Results:
Title: Archimedes Effect, The
Authors: Tom Clancy, Steve Pieczenik
Series: Net Force
Series index: 10.0

All is OK in Calibre, EXCEPT the author is interpreted as Tom Clancy;Steve Pieczenik, which is no good for author_sort.

I think I just need the little piece for the author extraction. I do not know Python and have guessed at what I have gotten so far, but can't figure out this part.

Ginny
Ginnia is offline   Reply With Quote
Old 06-07-2011, 02:07 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
I don't think you can do that in one shot. You'd basically have to modify the data Calibre reads from the file name, which isn't possible at the importing stage. The most painless way would probably be to either edit this manually, if it's only a couple of books, or to use the bulk metadata edit- there's a regular expression search & replace mode in that dialog that should easily do what you want.
Manichean is offline   Reply With Quote
Advert
Old 06-07-2011, 02:31 AM   #3
Ginnia
Connoisseur
Ginnia began at the beginning.
 
Posts: 51
Karma: 10
Join Date: Jan 2010
Device: Kindle
Thanks for responding, Manichean. If I could understand what the ".+" and the "[^_]+" means, it would help me noodle thru this I think.
Ginnia is offline   Reply With Quote
Old 06-07-2011, 04:12 AM   #4
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
The + indicates one or more occurrences of the preceding term. The '.' means any character. The values in square brackets means any of the listed characters.
itimpi is offline   Reply With Quote
Old 06-07-2011, 04:13 AM   #5
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,703
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Ginnia View Post
Thanks for responding, Manichean. If I could understand what the ".+" and the "[^_]+" means, it would help me noodle thru this I think.
".+" means "one or more of any character". "[^_]+" means "one or more of anything except an underscore."

Decoding this, the + means "one or more of the pattern preceding it". In the first case the pattern is ".", which means any character. In the second case the pattern is "[^_]", which is a "character class" pattern meaning "any character that is not an underscore". If you leave the "^" out of the character class, then it would mean "any character that is an underscore", or exactly the same as "_+".

The tutorial gives more information on character classes.
chaley is offline   Reply With Quote
Advert
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Books to Calibre Canadian reader Calibre 0 11-20-2010 06:31 PM
error adding books Beau Calibre 5 11-02-2010 12:03 PM
Possible error with adding new format of book already in Calibre TalpaEuropea Calibre 1 02-14-2010 08:51 AM
Error adding books Gfinch Calibre 2 08-03-2008 08:36 PM
Libprs500- error with adding previously converted books bluesnews Calibre 4 04-08-2008 11:06 PM


All times are GMT -4. The time now is 11:04 AM.


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