Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 06-22-2018, 07:54 PM   #1
retiredbiker
Enthusiast
retiredbiker is faster than slow light.retiredbiker is faster than slow light.retiredbiker is faster than slow light.retiredbiker is faster than slow light.retiredbiker is faster than slow light.retiredbiker is faster than slow light.retiredbiker is faster than slow light.retiredbiker is faster than slow light.retiredbiker is faster than slow light.retiredbiker is faster than slow light.retiredbiker is faster than slow light.
 
retiredbiker's Avatar
 
Posts: 43
Karma: 29896
Join Date: May 2013
Device: Kindle KB, Oasis, Ubuntu, Jutoh
Some searches don't respect "all text files"

I have several books with this in each file, in the <style> part of the file header:

Code:
.para-center {
    font-size: small;
    text-indent: 0;
    font-family: serif;
    text-align: center;
}
And I wanted to get rid of the "font-size: small;" lines. If I do a normal search/replace for the string "font-size: small;", the editor will only act on the line in the current file. Ctrl-N also says only one match. But this is in all 58 files. Same behaviour if I select the files and try searching on "selected files". And the same if I try the line "font-family: serif;". If I just use "Find" to step through all the occurrences, it just does this one file.

But, If I just search for "small" or "font" or "family", it finds everything in all the files - Ctrl-N gives the right number, and I can step through them all, whether they are in the headers or the text.

I tried searching for the whole block of text...it found and replaced 27 out of 58 occurrences, which is even worse than just doing one file, because you don't really know what it's done. I finally resorted to regex (.para-center{.*?}), and that seems to work reliably.

Anybody have any idea what could be blocking the multi-file search?

Thanks!
retiredbiker is offline   Reply With Quote
Old 06-22-2018, 11:02 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 33,071
Karma: 10034424
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Your files might look identical but they are not atually identical. There might be extra spaces or invisible characters, etc
kovidgoyal is offline   Reply With Quote
Old 06-23-2018, 02:51 PM   #3
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 4,645
Karma: 21503574
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Aura One, Aura H2O, Aura HD, Nexus 7 HD, iPad Air, Tolino epos
And I would suggest moving those styles to a single stylesheet just to make it easier to manage and edit.
DNSB is offline   Reply With Quote
Old 06-23-2018, 02:53 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: 21,784
Karma: 20975546
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: K4NT, Galaxy Tab 2(RIP)
Quote:
Originally Posted by DNSB View Post
And I would suggest moving those styles to a single stylesheet just to make it easier to manage and edit.
Amen!
theducks is offline   Reply With Quote
Old 06-23-2018, 06:46 PM   #5
deback
Book E d i t o r
deback knows the complete value of PI to the enddeback knows the complete value of PI to the enddeback knows the complete value of PI to the enddeback knows the complete value of PI to the enddeback knows the complete value of PI to the enddeback knows the complete value of PI to the enddeback knows the complete value of PI to the enddeback knows the complete value of PI to the enddeback knows the complete value of PI to the enddeback knows the complete value of PI to the enddeback knows the complete value of PI to the end
 
Posts: 276
Karma: 31930
Join Date: May 2015
Device: Laptop
One trick that works for me all the time is to hit the Beautify Files button and then do the search. When I don't do that, the search will not find all occurrences.
deback is offline   Reply With Quote
Old 06-23-2018, 09:43 PM   #6
retiredbiker
Enthusiast
retiredbiker is faster than slow light.retiredbiker is faster than slow light.retiredbiker is faster than slow light.retiredbiker is faster than slow light.retiredbiker is faster than slow light.retiredbiker is faster than slow light.retiredbiker is faster than slow light.retiredbiker is faster than slow light.retiredbiker is faster than slow light.retiredbiker is faster than slow light.retiredbiker is faster than slow light.
 
retiredbiker's Avatar
 
Posts: 43
Karma: 29896
Join Date: May 2013
Device: Kindle KB, Oasis, Ubuntu, Jutoh
Thanks everyone...

Yep, I agree that styles belong in a css file, not a text file. That's what I ended up doing. I just hit this weird behaviour while I was trying to figure out how this particular book worked, and it bugged me no end.

And yes, beautifying files can help...along with "\s+" in the right places to allow for variable spaces and lines. Sometimes I'll even do a regex: replace \n with a space character, then replace two space characters with one until the replacements hit zero...that really cleans up a raggety file.


I've hit other odd - very odd - cases where the "select all files" did not seem to work, but this was the first one that seemed to have some consistency to it, enough that I could try and figure it out. Still confused, but at a higher level!

Last edited by retiredbiker; 06-23-2018 at 09:48 PM.
retiredbiker is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre-generated epub (from .docx) gives "e21027" "multiple opf files" on KindleGen GhostRider Conversion 0 12-22-2017 09:06 AM
Find / Replace does not respect "down" setting DrChiper Editor 24 01-26-2014 06:10 PM
CSS to "wrap" text between two .xhtml files? december Sigil 28 12-06-2013 03:29 PM
KT "Ghost covers/files" again at 670 books, "stale" image entries in firmware VirgoGirl Kobo Reader 4 04-06-2012 02:10 PM
"Settings," then "311" - Int'l Kindle searches for wireless providers in the area Dr. Drib Amazon Kindle 2 08-28-2011 10:27 AM


All times are GMT -4. The time now is 08:50 AM.


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