Automatically populating metadata "tags" field from directory structure
I have a directory of math textbooks I'd like to add to Calibre. The directory structure is organized by the field of math involved, for instance:
I'd like to add the entire directory tree's worth of files into Calibre, and to have it populate the "tags" section of each file by the directory structure that it's in. So for instance, I'd like the first one to get the tags "pure, algebra, linear", and the second one to get the tags "applied, engineering".
I've looked at the "Control the adding of books" dialog, but can't figure out how to do it - is there some way to configure regular expressions to do this?