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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 12-03-2010, 10:09 AM   #1
iKarampa
Member
iKarampa began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Dec 2010
Device: Kindle
Question Regular Expression Help

I have some ebooks in the format:

Scientific American - 1993.12 - Taming Africanized Killer Bees
Scientific American Online - 2006 #28 - Evolution

What is the correct regular expression to read all these?
iKarampa is offline   Reply With Quote
Old 12-03-2010, 10:13 AM   #2
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80520
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
There's an introduction in the user manual.
Manichean is offline   Reply With Quote
Old 12-03-2010, 10:18 AM   #3
iKarampa
Member
iKarampa began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Dec 2010
Device: Kindle
Thank you,

I sincerely can not follow these, this is well above my understanding
iKarampa is offline   Reply With Quote
Old 12-03-2010, 11:42 AM   #4
kmack
Member
kmack has learned how to buy an e-book online
 
kmack's Avatar
 
Posts: 21
Karma: 87
Join Date: Jan 2008
Device: Nook, EBW-1150
"~^Scientific American"
Include the quotes, will get you everything that starts with the words Scientific American
kmack is offline   Reply With Quote
Old 12-03-2010, 11:48 AM   #5
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by kmack View Post
"~^Scientific American"
Include the quotes, will get you everything that starts with the words Scientific American
I think he's looking for a regex to import them with at least title. There is no "correct" or "best" answer. He'd need to specify what metadata (author, pubdate, publisher, series name, series_index) he's trying to extract from the title to answer his question.
Starson17 is offline   Reply With Quote
Old 12-03-2010, 11:56 AM   #6
iKarampa
Member
iKarampa began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Dec 2010
Device: Kindle
Thanks,

How would I use it to extract the info?

Scientific American - 1993.12 - Taming Africanized Killer Bees
Name=Scientific American
pubdate=1993.12
Title=Taming Africanized Killer Bees

For the other style:

Scientific American Online - 2006 #28 - Evolution

Name=Scientific American Online
not sure how I would store the 2006 #28 , maybe skip
Title=Taming Africanized Killer Bees



Quote:
Originally Posted by kmack View Post
"~^Scientific American"
Include the quotes, will get you everything that starts with the words Scientific American
iKarampa is offline   Reply With Quote
Old 12-11-2010, 05:31 AM   #7
RobW
Rob Wheeler (Kent, UK)
RobW is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!RobW is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!RobW is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!RobW is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!RobW is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!RobW is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!RobW is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!RobW is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!RobW is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!RobW is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!RobW is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!
 
Posts: 13
Karma: 50000
Join Date: Oct 2010
Location: Kent, UK
Device: Sony PRS-650
You could try...

^Scientific American.*?$

But not entirely sure from the question what you want to achieve. Could you give the original text and then the text you wamt to extract from it.
RobW is offline   Reply With Quote
Old 12-11-2010, 07:00 AM   #8
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
Posts: 1,104
Karma: 5168844
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Ubuntu Linux, Cybook Opus, Motorola Xoom with Mantano Premium
Quote:
Originally Posted by iKarampa View Post
How would I use it to extract the info?
You can't.

You can only extract Title, Authors, Series, Series index and ISBN using a regular expression as you add the book. Take a look at preferences for adding books.

But if you are in luck, the files you have may have all the correct metadata embeded in them. Then you can have Calibre read it directly from inside the file. Also something you specify in preferences for adding books.
Adoby is online now   Reply With Quote
Old 12-15-2010, 06:21 AM   #9
iKarampa
Member
iKarampa began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Dec 2010
Device: Kindle
Do you know the regular expression that would at least give me the title?
iKarampa is offline   Reply With Quote
Old 12-15-2010, 06:30 AM   #10
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 644
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD
Using the Scientific American as series a simple one would be
Code:
(?P<series>.*) - .* - (?P<title>.*)
Perkin is offline   Reply With Quote
Old 12-15-2010, 06:52 AM   #11
iKarampa
Member
iKarampa began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Dec 2010
Device: Kindle
Thank you for the reply.

I tried it with "Scientific American - 1993.12 - Taming Africanized Killer Bees" as test. It recognises "Scientific American - 1993" as title and for the series it gets no match.

Quote:
Originally Posted by Perkin View Post
Using the Scientific American as series a simple one would be
Code:
(?P<series>.*) - .* - (?P<title>.*)
iKarampa is offline   Reply With Quote
Old 12-15-2010, 07:14 AM   #12
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80520
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Try
Code:
(?P<series>.*?) - .*? - (?P<title>.*?)
Manichean is offline   Reply With Quote
Old 12-15-2010, 07:16 AM   #13
chaley
"chaley", not "charley"
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: 5,626
Karma: 857074
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by iKarampa View Post
Thank you for the reply.

I tried it with "Scientific American - 1993.12 - Taming Africanized Killer Bees" as test. It recognises "Scientific American - 1993" as title and for the series it gets no match.
The regexp does work. See the attached screenshot of the test.

You probably didn't perform the secret handshake. For the tests to work, you must have a file extension on your file name.
Attached Thumbnails
Click image for larger version

Name:	Clipboard01.jpg
Views:	58
Size:	100.5 KB
ID:	62840  
chaley is offline   Reply With Quote
Old 12-15-2010, 07:17 AM   #14
iKarampa
Member
iKarampa began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Dec 2010
Device: Kindle
Yes it works!
I did not know about the handshake!

Quote:
Originally Posted by Manichean View Post
Try
Code:
(?P<series>.*?) - .*? - (?P<title>.*?)

Last edited by iKarampa; 12-15-2010 at 07:20 AM.
iKarampa is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular Expression Help Azhad Calibre 86 09-27-2011 02:37 PM
Regular Expression Help smartmart Calibre 5 10-17-2010 05:19 AM
Need Help Creating a Regular Expression Worm Calibre 9 08-18-2010 01:20 PM
Help with the regular expression Dysonco Calibre 9 03-22-2010 10:45 PM
I don't know how to use wilcards and regular expression.... superanima Sigil 4 02-21-2010 09:42 AM


All times are GMT -4. The time now is 06:03 AM.


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