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.