03-19-2014, 08:51 AM | #1 |
Fanatic
Posts: 556
Karma: 1283268
Join Date: Mar 2010
Device: KindleDX,Kindle 4, Kindle Keyboard 3G
|
Sigil find and replace page numbers
I have a question about removing page numbers in Sigil. I found an epub of "The Sot Weed Factor", which is only available free in an OCRed scanned version. This means that headers have been integrated into the text, so that every page has "The Sot-Weed Factor [xxx]" (where xxx is the page number. It was easy to use "find and replace to get rid of "The Sot-Weed Factor", but the numbers are proving intractable (there are 860 of them).
This is what it looks like: <p>[ 315 ]</p> I've tried ever possible version of: <p>[ \d+ ]</p> or <p>[ (\d+) ]</p> but nothing works! It seems like the brackets are a problem ( [ ] ). Do you know any solution? |
03-19-2014, 09:18 AM | #2 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
The brackets are part of regex. To make them a literal character use \ in front of them.
<p>\[\d+\]</p> Or <p>\[(.+?)\]</p> to remove any thing with brackets around it. That is my guess. I am not a regex guru. |
03-19-2014, 09:43 AM | #3 | |
Fanatic
Posts: 556
Karma: 1283268
Join Date: Mar 2010
Device: KindleDX,Kindle 4, Kindle Keyboard 3G
|
Quote:
Thanks! |
|
03-20-2014, 08:03 AM | #4 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
You have to be careful of unintended consequences when you have regex selected without thinking and a period is in the search box. It will select all sorts of stuff other than intended. Thank goodness for the undo button!
It too needs the \ to find it in regex. |
03-20-2014, 08:40 PM | #5 | |
Fanatic
Posts: 556
Karma: 1283268
Join Date: Mar 2010
Device: KindleDX,Kindle 4, Kindle Keyboard 3G
|
Quote:
Thanks! |
|
03-28-2017, 06:33 PM | #6 |
Zealot
Posts: 102
Karma: 128
Join Date: Aug 2009
Location: Simi Valley, CA
Device: Kindle Paperwhite 1
|
I'm also trying to remove page numbers inserted by ABC Amber LIT. The code looks like this:
Code:
<p class="calibre3"> <b class="calibre1">Page 1</b></p> <p class="calibre3"> </p> |
03-28-2017, 06:57 PM | #7 |
A Hairy Wizard
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
In Sigil, regex search and replace:
search:<p class="calibre3">\s*<b class="calibre1">Page (\d+)</b></p> replace: (nothing) Try it on a few first before committing to the replace all...and save before you do! I would also replace all the <p class="calibre3"> with something that is descriptive. eg <p class="noindent"> or, if it is a basic paragraph type, replace it with just <p> |
03-28-2017, 08:06 PM | #8 |
Well trained by Cats
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
I suspect you may need
Code:
search:<p class="calibre3">\s*<b class="calibre1">Page\s+(\d+)</b></p>
|
03-28-2017, 08:51 PM | #9 |
A Hairy Wizard
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
yup yup! Thanks!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sigil Wildcards/Regex Find/Replace | Adman35 | Sigil | 7 | 08-16-2014 01:02 PM |
Kindle (AZW3/MOBI) ebooks with "real page numbers" to PDF with same page numbers? | abvgd | Conversion | 2 | 05-24-2013 01:24 PM |
Regex Help: Find page number & Replace+Remove 2x Line Breaks in Sigil | Contre-jour | Sigil | 9 | 02-01-2013 10:47 AM |
Wondering where I can find the "Alice in Wonderland" ePub used on the Sigil home page | Jon Westcot | Sigil | 6 | 11-13-2012 04:22 AM |
Sigil find/replace box | LucyLu | Sigil | 2 | 05-28-2012 11:33 AM |