Originally Posted by memenow
I have a big file that is separated into categories with an underscore beneath each category name. The file is constantly changing and there are 80 categories. It is a plain text file. I would like to make it so that each category name is a separate chapter in an epub file. I would also like to make sure each chapter name is the title of the chapter. Is there a way to do this automatically with Calibre? Maybe some regex magic? For example, I would like the chapter titles for the categories below to be: Fruit, Vegetables, Herbs. And I would like it to be parsed automatically (one way to do this would probably involve recognizing the underscores in a regex expression). How can I do this?
(Where you ca see the code and see the test results
before you save
('Discard' is my overworked friend
The Keyword you are looking for is 'markup'
IMHO, if you are going to do that much work... Do it the Sigil (and REGEX) way: (?sm)<p (.+?)</p>\s+<hr