05-07-2010, 07:12 PM | #1 |
Addict
Posts: 300
Karma: 1006538
Join Date: Jul 2008
Device: Kindle Paperwhite (11th Gen)
|
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 |
05-07-2010, 07:34 PM | #2 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
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.
|
Advert | |
|
05-07-2010, 07:43 PM | #3 |
Addict
Posts: 300
Karma: 1006538
Join Date: Jul 2008
Device: Kindle Paperwhite (11th Gen)
|
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 |
05-07-2010, 11:22 PM | #4 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Code:
(?P<series>[^\- ]+)-(?P<series_index>\d+) (?P<title>[^\(\)]*) |
|
05-08-2010, 02:06 AM | #5 |
Addict
Posts: 300
Karma: 1006538
Join Date: Jul 2008
Device: Kindle Paperwhite (11th Gen)
|
Thank you much =)
that worked fantastic. HEHE have NO idea why it works, but it works fantastically. |
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Regular Expression Help | Azhad | Calibre | 86 | 09-27-2011 03:37 PM |
Regular Expression Help | smartmart | Calibre | 5 | 10-17-2010 06:19 AM |
Regular Expression For Adding Books | jhart711 | Calibre | 3 | 09-27-2010 07:51 AM |
Help with the regular expression | Dysonco | Calibre | 9 | 03-22-2010 11:45 PM |
regular expression - importing vs testing | pbj | Calibre | 5 | 02-09-2010 04:02 PM |