![]() |
#1 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Dec 2010
Device: Kindle 3G-Wifi
|
RegEx - filename metadata help
I have read through most of the threads for Calibre and regular expressions, I am at a loss.
I have a lot of books that are all saved in the exact same format and I want to be able to extract the metadata from the filenames. Here are a couple of examples: Adams, Robert,Castaways In Time,01,Castaways in Time.txt Anderson, Kevin J.,Game Earth,01,Game Earth.txt All of them are: Author Last Name, First Name, Series Name, Series Index, and Title If there is no series or series index, the comma will still be there, for example: Aldiss, Brian W.,,,The Dark Light Years.txt Anderson, Poul,,,Brainwave.txt I know this is probably pretty easy and straightforward, but I can't seem to get my brain around this. And as long as I am asking for the world, is there some way when Calibre sends the file to my kindle it will add the series name and index to the title so that is shows, for example: Castaways in Time - 01 - Castaways in Time Castaways in Time - 02 - The Seven Magical Jewels of Ireland Any help would be appreciated. Thank you. Last edited by ejjenkins; 12-28-2010 at 04:00 PM. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
For importing metadata from filenames, you need regular expressions, for setting the path Calibre uses, you need the template language. There are tutorials available for both in the user manual.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Calibre Plugins Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,721
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Quote:
^(?P<author>([^,]+,[^,]+)),(?P<series>[^,]*),(?P<series_index>[^,]*),(?P<title>[^,]*) |
|
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Dec 2010
Device: Kindle 3G-Wifi
|
kiwidude - Thank you for such a quick response, I truly appreciate it. I tried it out on several with and without series information and it worked flawlessly.
Thank you very much. |
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Dec 2010
Device: Kindle 3G-Wifi
|
Manichean - Thank you for pointing me in the direction of the template language, that was pretty straightforward for what I wanted, now Calibre puts the books onto my Kindle with the naming convention I wanted. I just had no idea where to look for that feature.
Thank you very much! |
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
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 |