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 04-24-2015, 03:04 PM   #1
jlocicero
Member
jlocicero can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterjlocicero can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterjlocicero can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterjlocicero can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterjlocicero can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterjlocicero can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterjlocicero can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterjlocicero can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterjlocicero can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterjlocicero can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterjlocicero can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
Posts: 15
Karma: 12678
Join Date: Apr 2013
Device: none
search and remove two spaces

I want to remove instances of two spaces in a book I am editing. If I just seach for " " (two spaces) I get a lot of hits in parts of the book that are not book content - like css code.

What search term can I use to find two spaces in only text of the book?
jlocicero is offline   Reply With Quote
Old 04-24-2015, 03:20 PM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
If you have CSS in the HTML files, move it to a stylesheet. The search will only check HTML files (there are a few filters there).

Aside from that... it really, truly doesn't matter if you remove spaces from the stylesheets.
If you really want, replace everything and then use Beautify to fix the indentation.


Searching for spaces only in the HTML is too complex to be done with a trivial regex, you need to use specialized tools. For example, BeautifulSoup in python. Tools that were written to parse HTML, whereas regex is designed to parse text strings and has no idea what is in them.
eschwartz is offline   Reply With Quote
Advert
Old 04-24-2015, 03:22 PM   #3
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: 30,914
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by jlocicero View Post
I want to remove instances of two spaces in a book I am editing. If I just seach for " " (two spaces) I get a lot of hits in parts of the book that are not book content - like css code.

What search term can I use to find two spaces in only text of the book?
NOT TESTED

REGEX
Code:
([(\w)\s{2,}(\w)
find 2 or more space between words

Code:
\1\2
total removal you might want 1 after the \1

most render engines collapse multiple consecutive spaces anyway, so except for file size growth... why bother
EXCEPTION: inside a <Pre tag
theducks is online now   Reply With Quote
Old 04-24-2015, 03:23 PM   #4
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: 30,914
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Ninja'd by eschwartz
theducks is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS to indent paragraphs and remove spaces Alda Sigil 7 06-20-2014 05:36 AM
How to remove blank spaces? Mamaijee Conversion 2 04-09-2013 11:20 AM
Remove Double Spaces PortMan Calibre 20 05-13-2012 11:43 AM
How can I remove spaces from folder and file names? jusmee Calibre 1 11-06-2009 10:36 PM
Anyway to remove paragraph spaces in pdb files? twister Other formats 3 03-12-2009 09:36 PM


All times are GMT -4. The time now is 08:00 PM.


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