![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Feb 2014
Device: iPad
|
Need help with regex for adding ebooks
Hello I am trying to add metadata based on a pdfs title but I can't figure it out. My pdf titles are in the following format:
<title> (<author>, <publisher>, <published>).ext I have tried using a few regex I have found on here but they don't work for me. When I click Test usually I just get a title. Most of the posts I looked at had the data in a different format and simply swapping sections of the regex didn''t work (I assumed it wouldn't but tried anyway). I didm't have much luck following the tutorial on the Calibre website. Does anyone have a regex for the format I have? Thanks in advance, any help is appreciated. |
![]() |
![]() |
![]() |
#2 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Feb 2014
Device: iPad
|
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>[^\)]+) |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,003
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:
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 |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding books - regex help | tonyx3 | Library Management | 1 | 03-13-2013 08:21 AM |
Adding non-Amazon purchased ebooks | Staked | Amazon Kindle | 4 | 12-07-2011 02:59 AM |
Adding audio to ebooks? What? | JohnMorris | News | 15 | 09-10-2011 07:07 AM |
Problem with adding eBooks since 0.7.35 | Frenchwolfie | Calibre | 6 | 01-16-2011 12:05 PM |
A little help adding books and using regex. | Dragonator | Calibre | 7 | 12-17-2010 06:57 PM |