Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 12-11-2022, 03:31 AM   #1
vanishedsarah
Member
vanishedsarah began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jun 2018
Device: Kindle Oasis
Question Removing id="page123" from book html

I have a book that pretty much every line has id="page123" in it, with the number counting up every line. They look liked one of these two examples

https://imgur.com/a/WKBWIZs

https://imgur.com/a/WKBWIZs

I'm trying to change the code these page numbers are in and around, but having each line be completely different is proving above my knowledge.

How can I remove these, in the simplest way? I'm terrible with using expressions too, I just cant wrap my head around them. So, if ou're gonna recommend using expressions somehow, I'd be super grateful if you's make it dummy proof
vanishedsarah is offline   Reply With Quote
Old 12-11-2022, 03:36 AM   #2
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: 31,055
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I believe this will work MAKE SURE that is all it touches.
(those id don't really hurt other that take up file space, and modern readers have plenty in most cases)

Search (regex)
Code:
\sid="p\d+"
Replace
<leave blank>
theducks is offline   Reply With Quote
Advert
Old 12-11-2022, 03:55 AM   #3
vanishedsarah
Member
vanishedsarah began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jun 2018
Device: Kindle Oasis
That gave me an error

SelectorSyntaxError: Expected selector, got <DELIM '=' at 4>



Quote:
Originally Posted by theducks View Post
I believe this will work MAKE SURE that is all it touches.
(those id don't really hurt other that take up file space, and modern readers have plenty in most cases)

Search (regex)
Code:
\sid="p\d+"
Replace
<leave blank>
vanishedsarah is offline   Reply With Quote
Old 12-11-2022, 04:06 AM   #4
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 14,033
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Maybe
id\=\"page[0-9]*\"

I think \ means use next character as literal not execute so if I'm in doubt I escape with \

[ ] encloses a list
* repeats

d does mean any digit, but I've forgotten how to use that.

I'm inept at regex so I always click find a few times to make sure before doing Replace All!
Quoth is offline   Reply With Quote
Old 12-11-2022, 04:13 AM   #5
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: 31,055
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
\d digit
+ 1 or more times
* 0 or more
theducks is offline   Reply With Quote
Advert
Old 12-11-2022, 05:22 AM   #6
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,752
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
But before you remove the IDs, make sure none of them are being used for links.
JSWolf is offline   Reply With Quote
Reply

Tags
html book, page numbers


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Scan and fix the device" after removing a book with Calibre ownedbycats Devices 8 01-29-2022 08:20 PM
Pressing "Restore Defaults" under "Book Details" wipes all "Look & Feel" settings. MarjaE Library Management 1 03-30-2021 11:46 AM
HTML to MOBI. How to create book "start" location? tehmac Conversion 4 08-21-2012 08:21 PM
Changing book titles of epubs (specifically removing "Barnes & Noble Classic Series" jettrue Calibre 3 08-03-2010 09:02 AM


All times are GMT -4. The time now is 01:38 PM.


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