Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 01-07-2014, 01:31 PM   #1
gelbmitschwarzen
Junior Member
gelbmitschwarzen began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Sep 2011
Device: none
Question 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?
gelbmitschwarzen is offline   Reply With Quote
Old 01-07-2014, 09:17 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,771
Karma: 22666666
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
kovidgoyal is offline   Reply With Quote
Old 01-09-2014, 10:47 AM   #3
gelbmitschwarzen
Junior Member
gelbmitschwarzen began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Sep 2011
Device: none
thank you!
gelbmitschwarzen is offline   Reply With Quote
Old 08-23-2014, 11:44 AM   #4
comox
Enthusiast
comox began at the beginning.
 
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.
comox is offline   Reply With Quote
Old 12-14-2021, 04:14 AM   #5
tzzz
Junior Member
tzzz began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Dec 2021
Device: none
Quote:
Originally Posted by comox View Post
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.
Excactly what I'm also aiming for: Is there a way to have the Year set as default to January 1?

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
tzzz is offline   Reply With Quote
Old 03-17-2024, 06:16 AM   #6
wyced4
Junior Member
wyced4 began at the beginning.
 
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,
wyced4 is offline   Reply With Quote
Reply

Tags
filenames, metadata import, pubdate

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 04:18 AM.


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