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 01-02-2014, 02:38 PM   #1
pgilbr1
Junior Member
pgilbr1 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Dec 2011
Device: Kindle
Red face How to format regular expression for adding books?

I am needing to create a regular expression to add new books to my library. The books are in Series Series-Index Title - Author format. The expression I am currently using works if all the books have a series, but if it only has the title it does not work.
(?P<series>[^_0-9-]*)(?P<series_index>[0-9.2]*)\s*(?P<title>[^_].+) -?\s(?P<author>[^_-]+)

How do I get the expression to check if the series is part of the book name?
Thanks for any help!!
pgilbr1 is offline   Reply With Quote
Old 01-07-2014, 08:27 AM   #2
LadyKate
Fanatic
LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.
 
Posts: 515
Karma: 1470724
Join Date: Jul 2013
Location: Quebec CA
Device: android 4 (samsung tablet and asus tablet)
I think you need to eyeball them first but what about the metadata title/series/author info?
LadyKate is offline   Reply With Quote
Advert
Old 01-07-2014, 09:10 AM   #3
pgilbr1
Junior Member
pgilbr1 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Dec 2011
Device: Kindle
All of my books are named either Series # Title - Author or Title - Author. The expression works if the book is in a series but if it is just Title - Author it will pull the last 2 bytes of the Title for the Title and put the rest in the Series. Is there someway to check if the Series is missing so it will format Title - Author correctly?
pgilbr1 is offline   Reply With Quote
Old 01-11-2014, 08:05 PM   #4
LadyKate
Fanatic
LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.LadyKate ought to be getting tired of karma fortunes by now.
 
Posts: 515
Karma: 1470724
Join Date: Jul 2013
Location: Quebec CA
Device: android 4 (samsung tablet and asus tablet)
To use the regular expression to parse the title you must manually separate those books with just "author-title" from those with "series index - author - title" and those with "author - title - series index.

Have these books got metadata? I find it easier to add books and let the information fields be filled by the metadata imbedded in the book.
LadyKate is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding books, Regular expression help please Shadewing Library Management 13 04-04-2012 05:31 AM
Help in adding books using "regular expression" DM399 Calibre 2 07-08-2011 06:38 AM
Adding Books, regular expression smarties86 Calibre 4 12-19-2010 08:18 AM
Regular Expression on adding books. Lokro Calibre 4 11-06-2010 11:05 AM
Regular Expression For Adding Books jhart711 Calibre 3 09-27-2010 06:51 AM


All times are GMT -4. The time now is 08:55 AM.


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