06-22-2018, 07:54 PM | #1 |
Addict
Posts: 387
Karma: 1638210
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Jutoh, Kobo Forma
|
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; } 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! |
06-22-2018, 11:02 PM | #2 |
creator of calibre
Posts: 43,858
Karma: 22666666
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
|
06-23-2018, 02:51 PM | #3 |
Bibliophagist
Posts: 35,401
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
And I would suggest moving those styles to a single stylesheet just to make it easier to manage and edit.
|
06-23-2018, 02:53 PM | #4 |
Well trained by Cats
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
06-23-2018, 06:46 PM | #5 |
Book E d i t o r
Posts: 432
Karma: 288184
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.
|
06-23-2018, 09:43 PM | #6 |
Addict
Posts: 387
Karma: 1638210
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Jutoh, Kobo Forma
|
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. |
|
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 |