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 05-07-2010, 06:12 PM   #1
askyn
Addict
askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.
 
askyn's Avatar
 
Posts: 287
Karma: 1006538
Join Date: Jul 2008
Device: Nook ST Glow & PocketBook 360
Helping importing books using regular expression

Hi all /wave,

sorry to bother but I need some help setting up a expression to import a large group of books.

Using the file name as the data.

Here is the format:

AAA-#### blah blah blah.???

AAA = series, could be 2 or 3 letters
#### = series number, could be 1-4 numbers
blah blah blah = title of the book
??? = file extension ... dont care about

between aaa and #### is a dash
there is a space after ####

Could some kind soul please help me with a expression I could use when adding books for the above?

Thank you

PS - not sure it matters, once in a blue moon there wont be a series / series number. I can adjust those manually tho as there are only a couple
askyn is offline   Reply With Quote
Old 05-07-2010, 06:34 PM   #2
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 askyn View Post
Could some kind soul please help me with a expression I could use when adding books for the above?
Would you post 3 or 4 examples, just to make sure we've got the spaces and hyphens correct? It's easier to work with real filenames that can actually be tested, rather than a description of the filename format.
Starson17 is offline   Reply With Quote
 
Enthusiast
Old 05-07-2010, 06:43 PM   #3
askyn
Addict
askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.
 
askyn's Avatar
 
Posts: 287
Karma: 1006538
Join Date: Jul 2008
Device: Nook ST Glow & PocketBook 360
sure =)

random made up stuff, but has same format (note dont really care about authors name but what the heck will add in from examples i have ):

AB-321 A dog's life-sleeping all day.txt
SDF-102 Trees, the ultimate air cleaner (Ibe Breathing).rtf
BB-1253 Catfish revival - how fish fed a nation (Hookd Mah Hat).doc
CCS-3421 The world of Fluffer Numphs (Henry Elephant).txt

( just to be sure, ROFL, no I dont have books labled that ( altho the catfish one sounds fun )
(Yes, authors are always in the brackets)
(yes, series / series number are as displayed)

Hope that helps
askyn is offline   Reply With Quote
Old 05-07-2010, 10:22 PM   #4
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 askyn View Post
random made up stuff, but has same format (note dont really care about authors name
If you don't care about authors, try this:
Code:
(?P<series>[^\- ]+)-(?P<series_index>\d+) (?P<title>[^\(\)]*)
It's easy to write one that picks up authors, but when I did it, and you had no author, it defaulted to the entire filename as title.
Starson17 is offline   Reply With Quote
Old 05-08-2010, 01:06 AM   #5
askyn
Addict
askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.askyn ought to be getting tired of karma fortunes by now.
 
askyn's Avatar
 
Posts: 287
Karma: 1006538
Join Date: Jul 2008
Device: Nook ST Glow & PocketBook 360
Thank you much =)

that worked fantastic.

HEHE have NO idea why it works, but it works fantastically.
askyn 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
Regular Expression For Adding Books jhart711 Calibre 3 09-27-2010 06:51 AM
Help with the regular expression Dysonco Calibre 9 03-22-2010 10:45 PM
regular expression - importing vs testing pbj Calibre 5 02-09-2010 03:02 PM


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


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