01-07-2014, 01:31 PM | #1 |
Junior Member
Posts: 2
Karma: 10
Join Date: Sep 2011
Device: none
|
metadata from filename - published date
hello,
I am trying to import a list of books and add some of the metadata information from the filename (via regular expression). the syntax of the filenames is: series index (format 000) - date published (format yyyy-MM) - author - title for example: 001 - Original Oz Books - 1900-05 - Frank Baum - The Wonderful Wizard of Oz my problem is the date published field (pubdate), it does not recognize the yyyy-MM date format in the filename, so it's not accepted as a valid date. the online documentation for reading metadata from filenames. what expression do I have to use to get calibre to recognize the pubdate from the filename? |
01-07-2014, 09:17 PM | #2 |
creator of calibre
Posts: 44,017
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibre is perfectly capable of reading dates in the format yyyy-MM you simply have to setup your regular expression to match them, for example,
(?P<title>.+?) - (?P<published>.+) with read the published date as 1997-03 from test - 1997-03.epub |
01-09-2014, 10:47 AM | #3 |
Junior Member
Posts: 2
Karma: 10
Join Date: Sep 2011
Device: none
|
thank you!
|
08-23-2014, 11:44 AM | #4 |
Enthusiast
Posts: 38
Karma: 10
Join Date: Jan 2011
Device: none
|
I have a related question.
When I import a file name with date formatted as yyyy, for example: John Doe - This Is My Life - 2014 using: (?P<author>[^_]+) - (?P<title>.+) - (?P<published>.+) The field <published> is filled with 2014-08-15. Is there a way to have Year default to January 1? For example: 2014-01-01. |
12-14-2021, 04:14 AM | #5 | |
Junior Member
Posts: 1
Karma: 10
Join Date: Dec 2021
Device: none
|
Quote:
For example when importing a file as above: This Is My Life - 2014.pdf with: (?P<title>.+) - (?P<published>.+) Output in database is: Title: This Is My Life Published: 2014-12-15 (maybe it always sets the 15. of the month, in which the file was imported as default?) But the aim is to always get this: yyyy-01-01 Thus, Published: 2014-01-01 Thanks for help in advance |
|
03-17-2024, 06:16 AM | #6 |
Junior Member
Posts: 1
Karma: 10
Join Date: Mar 2024
Device: Pocketbook Touch Lux 5
|
Hi,
I'm not getting the correct result from importing the publication date metadata from the file name: My Regular expression (?P<title>.+) - (?P<series>.+) - (?P<series_index>[0-9]*) - (?P<published>.+) My filename Book name - bookser - 55 - Aug 2019.pdf The test result under settings appears to be correct with published date stating 2019-08-15, but the result after loading shows published as "undefined". What am I doing wrong? Best regards, |
Tags |
filenames, metadata import, pubdate |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Date first published | applesauce | General Discussions | 19 | 07-16-2013 07:46 AM |
How can I remove Published Date from metadata using ebook-meta | Pixelastic | Library Management | 6 | 11-10-2012 05:11 AM |
'Published date' and 'originally published date' | Arrghus | Calibre | 2 | 07-29-2011 12:43 AM |
Date published | philandjan | Library Management | 1 | 06-02-2011 11:43 AM |
Bulk Changing Published Date To Date | hmf | Calibre | 4 | 10-19-2010 10:19 PM |