05-06-2016, 11:16 AM | #1 |
Head of lunatic asylum
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
|
Edit Book: Inconsistency in Differences between books
With F&R (Find and Replace) (in MR also called S&R (Search and Replace)) I want to reduce double spaces to one, with command Replace all. I repeated the procedure several times, waited, no changes! Find: *SPACE**SPACE* Replace: *SPACE* 1212 occurrences Click: See what changed Calculating differences, please wait This window does not appear!? No changes found In fact, there was also nothing changed. My e-reader displays the locally occurring spaces in the words, but not the double spaces between. A similar (cosmetic) procedure I have already done some time before, successfully carried out in another book, there were more than 150000 occurrences. Interna: Roche (F) Last edited by chaot; 05-17-2016 at 05:59 AM. Reason: add image Calculating differences, please wait |
05-06-2016, 11:31 AM | #2 |
Well trained by Cats
Posts: 29,818
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
If in doubt, COPY (select, the ctrl-F) the search value (space pair), the underlying migt be another form of whitespace
REGEX \s\s might work, BUT it might also get line ends |
Advert | |
|
05-06-2016, 12:36 PM | #3 | |
Head of lunatic asylum
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
|
Quote:
Run Fix HTML - all files & Beautify all files Find: \s\s Replace: *SPACE* Replaced 3494 occurrences Differences between books (excerpt) Result: Optical confusion Run again Fix HTML - all files & Beautify all files Seems OK Checkbook was before, during and after the procedure OK. Or do you see/know something that I overlooked? Line end problems!? Last edited by chaot; 05-17-2016 at 05:05 AM. Reason: add: Line end problems, example→excerpt |
|
05-06-2016, 02:48 PM | #4 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Something to be careful of with your regex is that you might end up replacing consecutive non-breaking-spaces with a plain space. That might be important if nbsps have been used to create vertical whitespace scenebreaks. E.g.
Before: <p>*nbsp**nbsp*</p> After: <p>*plainspace*</p> The 'Before' paragraph will look like a blank line. The 'After' will be completely invisible. |
05-06-2016, 06:01 PM | #5 |
null operator (he/him)
Posts: 20,590
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
I think the pink blobs in the third shot probably indicate the presence of a 'special' space character. In codeview window, position the cursor immediately after a blob and the character details will be displayed at the right end of the status line.
What does the fourth shot look like in Preview - it appears to have a space between almost every character - but if that's what you want I guess it's OK. To address the issue jackie-w raises you could try replacing the nbsp at line beginnings with a marker, do the global replace, and then replace the markers with nbsp. BR |
Advert | |
|
05-18-2016, 12:22 PM | #6 | ||
Head of lunatic asylum
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
|
Quote:
To explain here my attempts with Find: \s\s respectively *SPACE**SPACE* (your and my way ) and Replace all would be very awkward. But the result is quite clear: It works unfortunately only unstable. Whether that applies only to this book mentioned here I do not know? Quote:
|
||
05-18-2016, 01:10 PM | #7 | ||||
Head of lunatic asylum
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
|
Quote:
The meaning of *nbsp* (non blanc spaces) is not clear to me. A *nbsp* must be syntactically somehow recognizable and different from the *plainspace* - or? Quote:
Differences between books (excerpt) (Image with pink blobs) Never mind which white or blanc spaces or plainspaces, the regular ones, the ones in some words or the double ones between the words: all called SPACE (in status line). EDIT Soon my head is also an empty space - yet it hums. There are NO-BREAK SPACES, colored yellow. Code View (Yellow space) NO-BREAK SPACE (Cursor behind yellow space) Quote:
without correction of double white spaces with correction of double white spaces Looks exactly the same. Quote:
Last edited by chaot; 05-18-2016 at 02:42 PM. Reason: add EDIT |
||||
05-18-2016, 02:08 PM | #8 | |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
A Regex search for \s will match both a normal space and an \xa0 (and other 'whitespace' chars for that matter, e.g. newline). If you only want to search for '2 or more consecutive normal spaces' then perhaps a regex search for Code:
[ ]{2,} |
|
06-02-2016, 11:07 AM | #9 | |
Head of lunatic asylum
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
|
Quote:
Replaced 1117 occurrences of [ ]{2,} |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre:Book Cover size in Book Details side pane & Edit Metadata Individually window | Volfer | Calibre | 3 | 01-05-2016 01:56 PM |
Default Edit Book Edit Window Font? | lhuxley | Editor | 2 | 03-26-2015 11:11 PM |
Aura Inconsistency between metadata in Calibre and on device | MariaS | Kobo Reader | 5 | 08-30-2014 06:53 AM |
Markdown: Anchor inconsistency on Kindle & Sony | Snorkledorf | Conversion | 3 | 01-05-2012 09:06 AM |