Register Guidelines E-Books Today's Posts Search

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
Grand Sorcerer
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: 6,208
Karma: 16534692
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
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 offline   Reply With Quote
Advert
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: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, 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


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 06:47 PM.


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