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 03-03-2009, 09:43 PM   #1
gandor62
Connoisseur
gandor62 began at the beginning.
 
gandor62's Avatar
 
Posts: 99
Karma: 14
Join Date: Jun 2008
Location: Brisbane Australia
Device: iPod Touch, Ipad, Kindle 2
Metadata Filename Syntax

Has anyone got a list of syntax formats for obtaining Metadata info from file names.

I can not figure it out at all.

This is what I have

(?P<author>.+) - (?P<series>.+) -(?P<title>[^_]+) it dont work

Author Name - [Series 1] - Title [htm format]

Series is causing me the Problem. Over the years I renamed a lot of titles and didnt put a space between the series and series number ie (Founadtion03). I tried to just put it into series index and sort out series name later, but cant seperate them. Was also hoping I could get it to ignore the format [format]

Tried a few things but I have no idea. I tried to search for tooltips as it mentions in the Config box. Hopefully someone can help. I cant work it out from the Python expression on my own.
gandor62 is offline   Reply With Quote
Old 03-03-2009, 09:53 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: 25,397
Karma: 4961459
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
[code]
(?P<author>.+) - (?P<series>.+?)(?P<series_index>\d+) -(?P<title>[^_]+) it dont work

Last edited by kovidgoyal; 03-03-2009 at 10:20 PM.
kovidgoyal is online now   Reply With Quote
Old 03-03-2009, 09:57 PM   #3
gandor62
Connoisseur
gandor62 began at the beginning.
 
gandor62's Avatar
 
Posts: 99
Karma: 14
Join Date: Jun 2008
Location: Brisbane Australia
Device: iPod Touch, Ipad, Kindle 2
Cheers. Thanks for that.
gandor62 is offline   Reply With Quote
Old 03-04-2009, 04:43 PM   #4
gandor62
Connoisseur
gandor62 began at the beginning.
 
gandor62's Avatar
 
Posts: 99
Karma: 14
Join Date: Jun 2008
Location: Brisbane Australia
Device: iPod Touch, Ipad, Kindle 2
So is there a web page or something that has more info or examples to use.

Like for example a syntax to solve this one from a file stored as

[series name] - series index - title (author)

Ive been playing with the python script, but very hard to understand when you want to get complicated. I was trying to retrieve the information and leave out brackets and such. I only have a few saved like this so I can do it manually but I was hoping for more pointers or the actual syntax would help my learning curve.

Last edited by gandor62; 03-04-2009 at 04:53 PM.
gandor62 is offline   Reply With Quote
Old 03-04-2009, 05:35 PM   #5
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 2,309
Karma: 5761596
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PRS-350, Nexus S, Galaxy S, Nook Color, iPhone4, iPT4, iPad 2012
Had the same problem. Found the following (linked from the XPath Tutorial) to be extremely helpful:
http://docs.python.org/library/re.html

It's pretty long, though, and it's hard to remember all the rules unless you use it frequently. I just keep the page open and refer to it every so often when playing with regular expressions in Calibre.
ilovejedd is offline   Reply With Quote
Old 03-04-2009, 05:42 PM   #6
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: 25,397
Karma: 4961459
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That website is linked to in the config dialog itself
kovidgoyal is online now   Reply With Quote
Old 03-04-2009, 06:04 PM   #7
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 2,309
Karma: 5761596
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PRS-350, Nexus S, Galaxy S, Nook Color, iPhone4, iPT4, iPad 2012
Lol, guess I just never noticed. Either that or Vista was acting up and won't open the links...

Hmm, for:
[series name] - series index - title (author)

Is this the correct syntax?
\[(?P<series>.+)\] - (?P<series_index>\d+) - (?P<title>.+) \((?P<author>.+)\)
ilovejedd is offline   Reply With Quote
Old 03-04-2009, 06:13 PM   #8
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: 25,397
Karma: 4961459
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
looks like but with regexps it's always best to test a little before using them
kovidgoyal is online now   Reply With Quote
Old 03-04-2009, 06:42 PM   #9
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 2,309
Karma: 5761596
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PRS-350, Nexus S, Galaxy S, Nook Color, iPhone4, iPT4, iPad 2012
Quote:
Originally Posted by kovidgoyal View Post
looks like but with regexps it's always best to test a little before using them
Tell me about it. Spent a good portion of a 4-day weekend just debugging regexps in a PHP script I was working on.

Ok. So basically, Calibre follows all regexp rules in Python, correct? Only thing added was the named variables/matches? What's the complete list of matches?
<title>
<author>
<series>
<series_index>
<isbn> ?
ilovejedd is offline   Reply With Quote
Old 03-04-2009, 07:12 PM   #10
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: 25,397
Karma: 4961459
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
yeah the calibre regexp is a python regexp (python has support for named matches). The available names correspond to the fileds in the test portion of the config dialog.
kovidgoyal is online now   Reply With Quote
Old 03-04-2009, 08:21 PM   #11
gandor62
Connoisseur
gandor62 began at the beginning.
 
gandor62's Avatar
 
Posts: 99
Karma: 14
Join Date: Jun 2008
Location: Brisbane Australia
Device: iPod Touch, Ipad, Kindle 2
Kewl Thanks for that. I helps heaps, I can see how they are working now.. gives me a good start.
gandor62 is offline   Reply With Quote
Old 01-06-2010, 04:05 PM   #12
turdette
Junior Member
turdette began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jan 2010
Location: Canada
Device: Aluratek Libre Pro, Ipad
HELP!

I have been trying to figure out the coding for the following:

[series series number] title - suthor

Could anyone help me? I am using Calibre.

Thanks!
turdette is offline   Reply With Quote
Old 07-16-2010, 04:38 PM   #13
ErikCartman
Junior Member
ErikCartman began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jul 2010
Device: Google G1
Question Stupid Question

Hi there,

I've seen that you understand these rules for correct filenamescans.

My collection of ebooks is very big so the scan have to work.
The difficulty therefore is that not all filenames have the same layout.

The ideal layout is:
Malcolm Gladwell - Blink - The power of thinking without thinking - 2005.pdf

<Author's> - <title> - <subtitle> - <year>.<fileformat>

Other books have for exmple 2 authors but now subtitle or no year.

How can I say calibre to detect the most things correct, so that i dosn't have to do all manual?

I would be very happy if somebody can give me a good solution

with respect
Erik
ErikCartman is offline   Reply With Quote
Old 07-16-2010, 04:48 PM   #14
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by ErikCartman View Post
How can I say calibre to detect the most things correct, so that i dosn't have to do all manual?
It depends on the filename formats. There is no "best." This thread has many options.
Starson17 is offline   Reply With Quote
Old 07-18-2010, 01:00 AM   #15
Partzz
Junior Member
Partzz began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jul 2010
Device: Blackberry
??? ??? Is there a Combo Save filename expression? Something that can generate a filename for AUTHOR - SERIES 00 - TITLE.ext and AUTHOR - TITLE.ext without having to re-enter for each individual group save? The postings in this forum look like Metadata Import only, but I didn't see a SAVE settings forum.
Partzz 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
Need help with metadata by filename artbatista Calibre 17 12-19-2009 07:51 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 10:11 AM.


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