View Single Post
Old 12-06-2023, 12:08 PM   #3
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,361
Karma: 20212223
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
I am so sorry for the delayed update...had a run to the emergency room and been dealing with that and this post completely slipped my mind.

The filename template code can be entered into Calibre's preferences by going to Preferences/Saving books to disk/Save template and adding the codes to your preference. I used the following for the Herbert example I gave above:
{author_sort} - {series} {series_index:0>2s|| - } {title}

----

To read the metadata from the filename (I actually think it might be the default??) go into Prefences/Adding books and clear the checkbox Read metadata from file contents rather than filename then you can put a template on how your filenames are layed out. This will properly read the Herbert filename example I gave above:
(?P<author>[^_-]+) -?\s*(?P<series>[^_0-9-]*)(?P<series_index>[0-9]*)\s*-\s*(?P<title>[^_].+) ?

There is a nice little test function in there to help you build the regex and check matches against your particular filename method.
Turtle91 is offline   Reply With Quote