@Josieb1, in answer to your question:
yes, if you rerun the program it should again add a blank TXT file as a new format to each book.
I updated it so it won't destroy TXT formats you already have, it will only add them to books without a TXT format. (See
post #35.)
The format
must be added via calibre's backend, in order for calibre to track it in the database -- so make sure you do it through the calibre interface or else through my .py file.