![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Dec 2019
Device: Kindle app on tablet
|
Editing an epub file
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 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,137
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
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! Cheers, |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,339
Karma: 133361584
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
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 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Dec 2019
Device: Kindle app on tablet
|
RE: editing using regular expressions
![]() 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. |
![]() |
![]() |
![]() |
Tags |
editing ebook in calibre, wild card |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
File list for editing | johngross | Editor | 1 | 10-07-2019 09:29 PM |
Problem editing a file | Terisa de morgan | Editor | 2 | 05-01-2018 07:26 AM |
Editing the file /etc/profile. How to??? | Kirith | Onyx Boox | 0 | 05-05-2013 03:37 PM |
Editing config file | James_Wilde | Sigil | 4 | 12-11-2010 10:22 AM |