Editing an epub file
#1  steveredshaw 12-29-2019, 03:00 AM
I need to take out all page number references from an epub file. They appear like this - <p class="calibre_"><span class="bold">Page 52</span></p>.

I can delete each one separately, but can I use a wild card term instead of the number to replace/delete all of them in one go?

#2  Turtle91 12-29-2019, 09:00 AM
Yes, you can. That technique is called RegEx (for Regular Expression). There are some different 'flavors' of regex depending on what software you are using, but they all generally support the basic commands.

There is a short explanation of RegEx in MR's Wiki.

You can try:
Search: <p class="calibre_"><span class="bold">Page (\d*?)</span></p>
Replace: (nothing)

Give it a try, one at a time until you are sure it isn't going to pick up something unwanted... then you can Replace All.

As always, save your epub first!


#3  JSWolf 12-29-2019, 09:01 AM
That sort of page numbering is usually found when a PDF is converted to ePub. If that is the case, there will be more errors then just page numbers.

#4  steveredshaw 12-29-2019, 11:56 AM
Thank you so much. Find and Replace is so powerful in Calibre! Apply changes to all files making up the book - that is so useful!!

Once I'd got familiar with the wild card terms and the Find and Replace section of the editing page, I was able to clean up the book in very little time.

It was a pdf file, which I wanted to read on my Kindle. Pdfs are a bit clumsy and inflexible when displayed via the Kindle app (no font size control for one thing), but a bit of cleaning up (yes there were other errors which I did correct - well probably most of them) and converting to Amazon file format made the book much easier and more pleasant to read.

Today's Posts | Search this Thread | Login | Register