View Single Post
Old 06-08-2021, 12:15 AM   #14
Skydog
Wizard
Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.
 
Skydog's Avatar
 
Posts: 2,286
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
Quote:
Originally Posted by retiredbiker View Post
I too dislike books like that, and my Forma dislikes them even more. If you have one huge file, the thing to do is open the book in the editor and split it up. Use the file split tool, located under the preview pane.

In your case it is easy, since you have those "<p class="page-break"></p>" lines where you want to split the file. Use that as a search term, go through the big file, and split at each one. Then use the ToC editor, and tell it to generate a ToC "from files". If you have reasonable headers at each chapter - first line of text, actually, it will use those to title the chapters. Some experimentation will show you how it goes, it's pretty easy.

Then search out and get rid of those page-break lines.

You could also do it in one go, using "Split at multiple locations" tool. Open that big file in the Editor and right-click anywhere in the code pane to get to the tool. Then use the wizard to make your X-path expression. You would use:
Tag name=p
attribute=class
value=page-break
in the wizard, then just click OK with the resulting expression. Caution: like any powerful tool, this can give you unexpected results, so know what is in that file in some detail before letting it rip.
Thank you, retiredbiker, I should have read your post first. I am keeping a copy of your instructions for a few others books suffering from the same problem. Since I had not yet read your post, I converted epub->epub and had calibre create a TOC, not knowing what would happen. Then, I manually edited each chapter (76 of them). Nothing like doing things the hard way. Now, I will take the same original and apply your instructions just to see how the results compare.

It's been years since I split a single file but I remember doing it in Sigil and somehow editing in Calibre. A lot of trial and error.

Thank you again, retiredbiker, for your assistance. There is so much to learn with Calibre that I don't know what I don't know.
Skydog is offline   Reply With Quote