|08-14-2009, 12:08 PM||#16|
Join Date: Jun 2009
Device: Palm Treo
@oldcrow74 The reason why the filenames didn't come out exactly as in the test cases may be because calibre imports metadata from the files and it might have found different info in the metadata than that based on the regex. Also, regex is not that hard to learn and once learned is very powerful. You can also use it in java.
|08-14-2009, 12:54 PM||#17|
creator of calibre
Join Date: Oct 2006
Location: Mumbai, India
calibre gets metadata from two sources, in the following order:
1) The file itself
2) The filename
(2) is only used if there is no metadata in the file itself. If you want (2) to be used in preference to 1, there is an option in preferences to do just that
|12-19-2009, 08:51 AM||#18|
Join Date: Oct 2009
Device: Kobo Aura One, Sony PRS T2, iPhone 6, Cybook Orizon, Cybook Gen3
how does the file need to have the metadata info written in it?
My books come from html files, where should I write the metadata?
(Maybe I could do so -almost- automatically, because before calibre I used to index my books in an excel spreadsheet)
I already tried to write them like this http://wiki.mobileread.com/wiki/Metadata#HTML_metadata, but when I add the book in calibre, it doesn't work.
My books are named as:
Harris, Charlaine - Aurora Teagarden 01 - 1990. Real Murders .htm
Harris, Charlaine - Sookie Stackhouse 04.1 - 2004. Fairy Dust .htm
As you can see, a lot of info in the filename.
So far, I've come up with this regular expression:
(?P<author>.+?) - ((?P<series>.+?) (?P<series_index>\d+) - )?(?P<title>.+)
but it recognizes metadata until the <title> (not included).
Can someone help me? Thank you.
Maybe I got it:
(?P<author>.+?) - ((?P<series>.+?) (?P<series_index>\d+) - )(?P<pubdate>\d+\.)(?P<title>.+)\[(?P<isbn>\d+)\]
Last edited by sbin; 12-19-2009 at 04:11 PM.
|Thread Tools||Search this Thread|
|Thread||Thread Starter||Forum||Replies||Last Post|
|Regex and Metadata from filename.||asrrin29||Calibre||2||09-20-2010 06:13 PM|
|Metadata in Title/filename||mezme||Calibre||0||08-18-2010 04:08 AM|
|Metadata Filename Syntax||gandor62||Calibre||15||07-18-2010 04:46 AM|
|Little Help with Metadata from Filename needed||plunderydoo||Calibre||4||09-06-2009 09:34 AM|
|Metadata from filename problem||kad032000||Calibre||0||05-24-2009 03:26 AM|