View Single Post
Old 02-14-2014, 07:01 AM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,099
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by myusernameis View Post
OK, I have figured out a regex that does what I need except that it doesn't do the date right. I have the dates as just the 4 digit year in the file names but they get extracted as YEAR-02-15. So the 4 digit year is correct but it makes every document have a month/day of 02/15. How can I stop the day month from being added?

regex I am using:

^(?P<title>([^_\(]+)(\w+)) \((?P<author>[^\,]+)\, (?P<publisher>[^\,]+)\, (?P<published>[^\)]+)
A 'date' has YEAR AND MONTH AND DAY (at least internally).
It has to or 'date' arithmetic would not be possible.
Calibre assumes the missing data from the current date.
(when I encounter Published with a missing Month detail, I use '1'
I also us '1' for day because my preferred, faked in flag, last day, is not a fixed value

There is a: Preferences: Tweaks: to control the 'Display' of dates (by field) in the GUI. Note:the full date will still show in exported metadata
theducks is offline   Reply With Quote