I have a somewhat similar problem. I have in excess of 500 htm files from a decompiled CHM (for just one book, but a few have the same problem):
1.that have individual sub-chapters as different htm files in different folders to denote main chapters (numbered 1 to 12)
2.the original CHM creators never bothered heading their documents, so there is no way to generate a TOC in the first place
Since we can't use folders in Sigil, or EPUB for that matter to distinguish the loads of htm files, I would have to batch rename files to match their main chapters as there a few that are the same (e.g. Introduction) (which I'm okay with).
Finding and replacing tags through all selected html files seems the way to go to create a TOC. But the suitable tag I could find is, for example, below:
> Front of Book > Conflicts of interest: none declared
Question is, how do I find and replace these tags (or what regex do I use)?
Or maybe other ways?