Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-19-2014, 08:51 AM   #1
montalex
Fanatic
montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.
 
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?
montalex is offline   Reply With Quote
Old 03-19-2014, 09:18 AM   #2
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
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.
mrmikel is offline   Reply With Quote
Old 03-19-2014, 09:43 AM   #3
montalex
Fanatic
montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.
 
Posts: 556
Karma: 1283268
Join Date: Mar 2010
Device: KindleDX,Kindle 4, Kindle Keyboard 3G
Quote:
Originally Posted by mrmikel View Post
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.
To me, you are a regex guru! <p>\[(.+?)\]</p> worked. Phew! That felt good, like trimming a hedge...

Thanks!
montalex is offline   Reply With Quote
Old 03-20-2014, 08:03 AM   #4
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
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.
mrmikel is offline   Reply With Quote
Old 03-20-2014, 08:40 PM   #5
montalex
Fanatic
montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.montalex ought to be getting tired of karma fortunes by now.
 
Posts: 556
Karma: 1283268
Join Date: Mar 2010
Device: KindleDX,Kindle 4, Kindle Keyboard 3G
Quote:
Originally Posted by mrmikel View Post
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.
Indeed! One of the scripts I tried found and replaced half of the book! Yours only removed page numbers between brackets.

Thanks!
montalex is offline   Reply With Quote
Old 03-28-2017, 06:33 PM   #6
911jason
Zealot
911jason doesn't litter911jason doesn't litter
 
911jason's Avatar
 
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>
How can I remove all instances of PAGE ### through the file?
911jason is offline   Reply With Quote
Old 03-28-2017, 06:57 PM   #7
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
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>
Turtle91 is online now   Reply With Quote
Old 03-28-2017, 08:06 PM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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>
if your example is true (has multiple spaces, depends on # of digits)
theducks is offline   Reply With Quote
Old 03-28-2017, 08:51 PM   #9
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
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!
Turtle91 is online now   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 07:49 PM.


MobileRead.com is a privately owned, operated and funded community.