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 09-12-2018, 06:46 AM   #1
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Searching for empty paragraph

Hi

I am probably doing something wrong. I am looking for all empty paragraphs left in my book to destroy them. I copy one of them from the code page.

Code:
<p> </p>
I paste it in the search field, it appears this way:

Code:
<p>\ </p>
It finds only one occurrence in the current file (I ask to search for all text files).

If I use Sigil to search for

Code:
<p>&#_160;</p>
I find all the 29 empty paragraphs in the book.

I would like to obtain the same result with the Calibre editor.
roger64 is offline   Reply With Quote
Old 09-12-2018, 07:22 AM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Try:

Code:
<p>\s</p>
That should match any type of space.
davidfor is offline   Reply With Quote
Advert
Old 09-12-2018, 08:18 AM   #3
deback
Book E d i t o r
deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.
 
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
Run the Beautify Files function within Calibre before doing searches. This will fix the problem you're having.
deback is offline   Reply With Quote
Old 09-12-2018, 10:25 AM   #4
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by davidfor View Post
Try:

Code:
<p>\s</p>
That should match any type of space.
I had done it before. Got the same result: only item found from the current file.
Attached Thumbnails
Click image for larger version

Name:	search.png
Views:	156
Size:	25.9 KB
ID:	166246  
roger64 is offline   Reply With Quote
Old 09-12-2018, 10:47 AM   #5
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: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That's a non-breaking space. Search for

<p>\xa0</p>
kovidgoyal is online now   Reply With Quote
Advert
Old 09-12-2018, 12:32 PM   #6
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by kovidgoyal View Post
That's a non-breaking space. Search for

<p>\xa0</p>
I obtain the same result. Only one item in the current file. There seems to be something wrong with my search.
roger64 is offline   Reply With Quote
Old 09-12-2018, 12:47 PM   #7
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: 29,792
Karma: 54830978
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 roger64 View Post
I obtain the same result. Only one item in the current file. There seems to be something wrong with my search.
How about using the repetition modifier?
Code:
<p>\s*</p>
Zero or more occurrences
That would also pick up combinations of multiple types of spaces
theducks is offline   Reply With Quote
Old 09-12-2018, 02:34 PM   #8
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by theducks View Post
How about using the repetition modifier?
Code:
<p>\s*</p>
Zero or more occurrences
That would also pick up combinations of multiple types of spaces
Same results. And searching this same ePub yields 29 items with Sigil...
roger64 is offline   Reply With Quote
Old 09-12-2018, 06:10 PM   #9
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,565
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@roger64 - did you try the suggestion in post #3

BR
BetterRed is offline   Reply With Quote
Old 09-12-2018, 06:13 PM   #10
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: 29,792
Karma: 54830978
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 BetterRed View Post
@roger64 - did you try the suggestion in post #3

BR
Beautify tends to fix many hit or miss search fails.
theducks is offline   Reply With Quote
Old 09-12-2018, 10:03 PM   #11
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: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by roger64 View Post
I obtain the same result. Only one item in the current file. There seems to be something wrong with my search.
Well if you provide us with a sample epub demonstrating the issue we can tell you more, otherwise it is just guesswork
kovidgoyal is online now   Reply With Quote
Old 09-13-2018, 01:41 AM   #12
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Yes, I shall prepare one asap.
roger64 is offline   Reply With Quote
Old 09-13-2018, 08:18 AM   #13
deback
Book E d i t o r
deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.
 
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
I'm in the habit of hitting the Beautify Files icon before I search for anything, because if I don't do that, most of the time the search function will not find what I'm looking for. Have you tried my suggestion yet?
deback is offline   Reply With Quote
Old 09-13-2018, 08:32 AM   #14
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by deback View Post
I'm in the habit of hitting the Beautify Files icon before I search for anything, because if I don't do that, most of the time the search function will not find what I'm looking for. Have you tried my suggestion yet?
No, I did not try it because it seemed unrelated to my problem which concerns randomly some ePubs of mine (but not all). However, I tried it now and, much to my surprise, this time the search found out all the items. I was unable to point exactly what part of the Beautify process solved this.

Thank you for a practical solution.

I also had seen that if I "scrambled" the ePub, the scrambled version did not suffer anymore from this defect. But the resulting ePub was of course unusable.

Good to know anyway, again thanks.

Note: I sent the "guilty" ePub to Kovid Goyal but could not publish it here. Maybe he will be able to tell us what disturb the Calibre editor for this particular search.

Last edited by roger64; 09-13-2018 at 09:15 AM. Reason: disturb
roger64 is offline   Reply With Quote
Old 09-13-2018, 11:01 AM   #15
deback
Book E d i t o r
deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.
 
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
Quote:
Originally Posted by roger64 View Post
No, I did not try it because it seemed unrelated to my problem which concerns randomly some ePubs of mine (but not all). However, I tried it now and, much to my surprise, this time the search found out all the items. I was unable to point exactly what part of the Beautify process solved this.

Thank you for a practical solution.

Note: I sent the "guilty" ePub to Kovid Goyal but could not publish it here. Maybe he will be able to tell us what disturb the Calibre editor for this particular search.
Glad it worked for you. I knew it would, because I always have to run the Beautify Files before I search for anything. If I don't do that, the search function will almost always NOT work correctly. I don't know if this is a bug in the Search function or not, but running the Beautify Files is definitely a necessity when you want to search for something.

This solution should be added to the instructions for the Search function.
deback is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching for empty entries reluniks Calibre 2 11-12-2016 02:29 PM
Searching for empty tadas Library Management 2 04-20-2015 12:14 AM
Empty space in Paragraph odedta ePub 11 12-27-2014 09:18 AM
How detelete empty paragraph? cyttorak Recipes 2 11-27-2014 02:41 AM
Searching for empty tags iain_benson Calibre 2 01-27-2009 05:04 PM


All times are GMT -4. The time now is 09:38 AM.


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