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 08-01-2011, 11:33 AM   #1
thevoiceofcheese
Junior Member
thevoiceofcheese began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Aug 2011
Device: none
regex help please

i just discovered calibre and now i try to work into it, but regular expressions are a obstacle i can't break through until now. i have no clue about programming whatsoever and after hours of trying i give up. i have a huge collection of mainly scientific books, the filenames are in this format: <author> <year> <tiltle>, e.g. "tabachnick 2007 using multivariate statistics.pdf". what i want to do is to extract metadata from filenames. i used this regex: (?P<author>[^_]+) (?P<published>\d\d\d\d) (?P<title>.+). it correctly extracts author and title , but in the published-field it extracts 2007-07-31 any ideas what is wrong with the regex? thanks in advance!
thevoiceofcheese is offline   Reply With Quote
Old 08-01-2011, 11:57 AM   #2
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 2,789
Karma: 3973173
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"
I stand to be corrected but I'm not sure anything is wrong. The 'published' field is expecting a valid date. Your filename only contains the 'year' portion so Calibre has created the 'month' and 'day' portions as today's month and day.
jackie_w is online now   Reply With Quote
 
Enthusiast
Old 08-01-2011, 11:27 PM   #3
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,838
Karma: 12535517
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
If you change the Tweak to display the year only, you would only see 2007. It works for me, YMMV.

# Control how dates are displayed

gui_pubdate_display_format = 'yyyy'
DoctorOhh 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
Regex Faster Sigil 2 04-24-2011 09:08 PM
regex replace??? schuster Conversion 14 01-29-2011 09:02 AM
What a regex is Worldwalker Calibre 20 05-10-2010 05:51 AM
Help with a regex A.T.E. Calibre 1 04-05-2010 07:50 AM
Regex help... Bobthebass Workshop 6 04-26-2009 03:54 PM


All times are GMT -4. The time now is 09:00 PM.


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