08-14-2009, 11:08 AM | #16 |
Connoisseur
Posts: 71
Karma: 422
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, 11:54 AM | #17 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
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 |
Advert | |
|
12-19-2009, 07:51 AM | #18 |
Voracious reader
Posts: 56
Karma: 14644
Join Date: Oct 2009
Device: Kobo Aura One, Sony PRS T2, iPhone 6, Cybook Orizon, Cybook Gen3
|
I'm curious about option 1):
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 https://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 [9780425218716].htm Harris, Charlaine - Sookie Stackhouse 04.1 - 2004. Fairy Dust [9780441011977].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. --edit: 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 03:11 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Regex and Metadata from filename. | asrrin29 | Calibre | 5 | 12-03-2023 04:51 AM |
Metadata in Title/filename | mezme | Calibre | 0 | 08-18-2010 03:08 AM |
Metadata Filename Syntax | gandor62 | Calibre | 15 | 07-18-2010 03:46 AM |
Little Help with Metadata from Filename needed | plunderydoo | Calibre | 4 | 09-06-2009 08:34 AM |
Metadata from filename problem | kad032000 | Calibre | 0 | 05-24-2009 02:26 AM |