![]() |
#1 |
Connoisseur
![]() 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. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,268
Karma: 27111060
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. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() Posts: 99
Karma: 14
Join Date: Jun 2008
Location: Brisbane Australia
Device: iPod Touch, Ipad, Kindle 2
|
Cheers. Thanks for that.
|
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() 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. |
![]() |
![]() |
![]() |
#5 |
hopeless n00b
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,110
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
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. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,268
Karma: 27111060
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That website is linked to in the config dialog itself
|
![]() |
![]() |
![]() |
#7 |
hopeless n00b
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,110
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
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>.+)\) |
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,268
Karma: 27111060
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
|
![]() |
![]() |
![]() |
#9 | |
hopeless n00b
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,110
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
Quote:
![]() 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> ? |
|
![]() |
![]() |
![]() |
#10 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,268
Karma: 27111060
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.
|
![]() |
![]() |
![]() |
#11 |
Connoisseur
![]() 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.
|
![]() |
![]() |
![]() |
#12 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Jan 2010
Location: Canada
Device: Aluratek Libre Pro, Ipad
|
HELP!
![]() [series series number] title - suthor Could anyone help me? I am using Calibre. Thanks! |
![]() |
![]() |
![]() |
#13 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Jul 2010
Device: Google G1
|
![]()
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 |
![]() |
![]() |
![]() |
#14 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
|
|
![]() |
![]() |
![]() |
#15 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2010
Device: Blackberry
|
???
![]() ![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |
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 |