There are a lot of plugins that act on multiple books in the library, read them somehow and then update the metadata. I think a good example of this would be the Count Pages plugin. That actually reads the books, extracts the text and processes it (calculates various statistics) and then update the metadata with those values. That fits fairly well with what you are doing. I would suggest looking at that plugin and then asking questions about what you don't understand and need to do.
Alternatively, it might be possible do this using the Actions Chains plugin. It might be able to run the commands and it has ways to update the metadata for a book. I haven't explored it, so I am not sure if it would work.
Another way is to do this externally using various calibre commands including calibredb. With that, you could use calibredb to search for the books to be changed, convert it to text externally to calibre, process the text and then use calibredb to update metadata.
|