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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-14-2009, 11:08 AM   #16
myle00
Connoisseur
myle00 has a complete set of Star Wars action figures.myle00 has a complete set of Star Wars action figures.myle00 has a complete set of Star Wars action figures.myle00 has a complete set of Star Wars action figures.myle00 has a complete set of Star Wars action figures.
 
myle00's Avatar
 
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.
myle00 is offline   Reply With Quote
Old 08-14-2009, 11:54 AM   #17
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: 26,121
Karma: 5101571
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
kovidgoyal is online now   Reply With Quote
Old 12-19-2009, 07:51 AM   #18
sbin
Voracious reader
sbin began at the beginning.
 
sbin's Avatar
 
Posts: 28
Karma: 10
Join Date: Oct 2009
Device: Sony PRS T2, iPhone 4s, 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 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 [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.
sbin is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regex and Metadata from filename. asrrin29 Calibre 2 09-20-2010 05:13 PM
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


All times are GMT -4. The time now is 02:14 AM.


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