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 02-09-2011, 12:35 AM   #1
Ulfrich
Junior Member
Ulfrich began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2011
Device: Nook
Regex setup for file name scheme

Ok these have been posted up several times and I am unfortunately unable to wrap my head around how to create these. Its unfortunate cause I have things named under several different formats. The current one Im working with looks like this for a series.

ebook - Alan Dean Foster - Spellsing 1 - Spellsinger

And this is for a none series.

ebook - Diana Wynne Jones - Howl's Moving Castle

Can anyone post me up a string that will remove the ebook portion and leave me with title author and series all in the right places?

Edit: I saw another format which was

SciFi - Christopher Stasheff - Warlock 2 - Spite of Himself

so I'm pretty much tryin to lop off the front end of each file name for the import

Last edited by Ulfrich; 02-09-2011 at 12:38 AM.
Ulfrich is offline   Reply With Quote
Old 02-09-2011, 01:04 AM   #2
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,801
Karma: 12534285
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by Ulfrich View Post
Ok these have been posted up several times and I am unfortunately unable to wrap my head around how to create these. Its unfortunate cause I have things named under several different formats. The current one Im working with looks like this for a series.

ebook - Alan Dean Foster - Spellsing 1 - Spellsinger

~~~

SciFi - Christopher Stasheff - Warlock 2 - Spite of Himself

so I'm pretty much tryin to lop off the front end of each file name for the import
You can do what I do and use something like Freecommander and bulk rename those files, easily lopping off the front end. Once this is done the following regex in Adding books should work for you. Just don't ask me to explain it.

Code:
^((?P<author>([^\-_0-9]+)(?=\s*-\s*)(?!\s*-\s*[0-9.]+)|\b))(\s*-\s*)?((?P<series>[^0-9\-]+)(\s*-\s*)?(?P<series_index>[0-9.]+)\s*-\s*)?(?P<title>[^\-_0-9]+)
DoctorOhh is offline   Reply With Quote
 
Enthusiast
Old 02-09-2011, 01:08 AM   #3
Ulfrich
Junior Member
Ulfrich began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2011
Device: Nook
Thanks for the quick response, Ill have to check that program out. Tho I do admit Im tempted to ask to have it explained by someone who understands it and so I can ask questions, I could probably get it then.
Ulfrich is offline   Reply With Quote
Old 02-09-2011, 01:21 AM   #4
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,801
Karma: 12534285
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by Ulfrich View Post
Thanks for the quick response, Ill have to check that program out. Tho I do admit Im tempted to ask to have it explained by someone who understands it and so I can ask questions, I could probably get it then.
You can start with this sticky thread An introduction to regular expressions and/or this tutorial in the manual, then ask all the questions you want. I just haven't bothered to gather the expertise to answer this question in detal.

Good Luck.
DoctorOhh is offline   Reply With Quote
Old 02-09-2011, 10:09 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 dwanthny View Post
You can do what I do and use something like Freecommander and bulk rename those files, easily lopping off the front end. Once this is done the following regex in Adding books should work for you. Just don't ask me to explain it.

Code:
^((?P<author>([^\-_0-9]+)(?=\s*-\s*)(?!\s*-\s*[0-9.]+)|\b))(\s*-\s*)?((?P<series>[^0-9\-]+)(\s*-\s*)?(?P<series_index>[0-9.]+)\s*-\s*)?(?P<title>[^\-_0-9]+)
If he's going to use a regex, the regex can lop off the front end easily, as long as the front end is consistently preceded by the space - hyphen - space form.
Just stick a non-greedy match .*? for anything followed by a space - hyphen - space in front and it matches, but ignores the stuff in front of the first space - hyphen - space.
This should do it:

Code:
^.*? - ((?P<author>([^\-_0-9]+)(?=\s*-\s*)(?!\s*-\s*[0-9.]+)|\b))(\s*-\s*)?((?P<series>[^0-9\-]+)(\s*-\s*)?(?P<series_index>[0-9.]+)\s*-\s*)?(?P<title>[^\-_0-9]+)
Starson17 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
The New Agency Pricing Scheme is Total B.S. The-eBook-Reader General Discussions 44 04-08-2010 07:24 PM
Sony is following the new industry standard pricing scheme. thafrogggg News 7 04-01-2010 03:36 PM
Change catalog scheme sjohnson717 Calibre 5 03-04-2010 02:10 AM
New rewards scheme at Directebooks.com Direct Ebooks News 4 02-17-2010 11:44 PM
How to setup a PDF file for the PRS-505 James Cole Sony Reader 6 02-17-2009 11:04 PM


All times are GMT -4. The time now is 05:54 PM.


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