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 12-01-2024, 12:15 AM   #1
MAH
Junior Member
MAH began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Nov 2024
Device: iPad Pro 13 (M4)
Question Search and Replace bug <p></p> to </h4>

kovidgoyal called this bug report invalid and suggested I try here. So, here it is:

Bug description:

calibre version 7.22.0

macOS 13.7.1 (22H221)

Intel iMac 3.6 GHz 10-Core Intel Core i9


Certain search strings won’t show correct results over multiple files. The specific failure I am having today is searching for "<p></p>" to be replaced with "</h4>". I have 40 chapters for my book, and every chapter had the <p></p> needing to be replaced with </h4>. I could search and replace across all files for things like </h4> for </h4>, but the <p></p> for </h4> would only successfully replace on one HTML file at a time. This made me have to open each file in succession in order to accomplish the desired search and replace operation. I have other examples, but I will defer listing them for now. This is an easy string to try the problem with and my other examples have similar results. I used "Normal" and "Regex" as my search and replace mode to see if a different search mode would show different results. For all tries there was no change in returned results.

Help!
MAH is offline   Reply With Quote
Old 12-01-2024, 12:39 AM   #2
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Just tested it and found no problems with the S&R. All instances were changed...
Do you have "All text files" selected? Maybe you have selected "Current Page"?
Attached Thumbnails
Click image for larger version

Name:	replace h4.jpg
Views:	149
Size:	197.2 KB
ID:	212297   Click image for larger version

Name:	Replace h4_1.jpg
Views:	139
Size:	201.5 KB
ID:	212298  
Karellen is offline   Reply With Quote
Old 12-01-2024, 12:40 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: 46,168
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I went with the same assumption that @Karellen did that you had a header in each file shown as <h4>Blah de blah<p></p>. I created an epub with 72 chapters which checkepub was very unhappy with. I then did a search for <p></p> and replaced with </h4> and the operation ran over all 72 chapters without issue.

The only way I could duplicate your issue was to select Current file instead of All text files.
DNSB is online now   Reply With Quote
Old 12-01-2024, 05:15 PM   #4
retiredbiker
Evangelist
retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.
 
retiredbiker's Avatar
 
Posts: 450
Karma: 3886916
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Kobo Forma
Over the years I have had a few books where this happened. I'm pretty sure that the search and replace worked fine over the entire book at first, but then I did something, and it suddenly would only do one file at a time. There was a bit of discussion a couple of years ago, and I was unable to replicate it at the time. I've been waiting for a book where it happened again so I could trap it, but no luck so far.
retiredbiker is offline   Reply With Quote
Old 12-01-2024, 05:21 PM   #5
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: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I have this happn more than once.
Beautify the book.
There is something else (non-printing) on those lines and it is not consistent.
That usually clears it up
theducks is offline   Reply With Quote
Old 12-08-2024, 12:13 AM   #6
MAH
Junior Member
MAH began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Nov 2024
Device: iPad Pro 13 (M4)
Thanks

Quote:
Originally Posted by theducks View Post
I have this happn more than once.
Beautify the book.
There is something else (non-printing) on those lines and it is not consistent.
That usually clears it up
I will try this one.

For the other guys, I am running on an Intel iMac running Mac OS 13.x.x, so sometimes the search libraries are different between different versions of the OS or between OSs like Python on the Mac was always a version behind what was on Windows and I couldn’t run my updated Python programs until the Python libraries were updated for Mac. While not an expert, hence my visit here, I have been parsing code for 40+ years and running searches for same, so yeah I can read the tags at the bottom of the search box, and I am certain of the failures in the search described.

I haven’t done it yet, but I will probably try to update to Mac OS 15.x.x and see if things get better.
MAH is offline   Reply With Quote
Old 12-20-2024, 07:33 PM   #7
MAH
Junior Member
MAH began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Nov 2024
Device: iPad Pro 13 (M4)
Quote:
Originally Posted by theducks View Post
I have this happn more than once.
Beautify the book.
There is something else (non-printing) on those lines and it is not consistent.
That usually clears it up
Quote:
Originally Posted by MAH View Post
I will try this one.

For the other guys, I am running on an Intel iMac running Mac OS 13.x.x, so sometimes the search libraries are different between different versions of the OS or between OSs like Python on the Mac was always a version behind what was on Windows and I couldn’t run my updated Python programs until the Python libraries were updated for Mac. While not an expert, hence my visit here, I have been parsing code for 40+ years and running searches for same, so yeah I can read the tags at the bottom of the search box, and I am certain of the failures in the search described.

I haven’t done it yet, but I will probably try to update to Mac OS 15.x.x and see if things get better.
Well, I updated to Mac OS 15.x and the problem continued. However, I used the “Beautify” command and it cleared the crud/detritus and my searches were doing everything at once like they should. So, theducks thank you very much for the sage advice. I really appreciate it!
MAH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
5.1.0 bug in "search and replace" regex field Snowman Library Management 4 10-05-2020 10:17 AM
Major Bug in Search/Replace in Calibre 4.13 JSWolf Calibre 11 03-29-2020 06:19 PM
Bug? No --search-replace processing in Windows TechnoCat Conversion 3 06-12-2017 11:28 AM
Calibre 2.25 Bug in Convert Book Search and Replace Linux Mint 17 gbm Conversion 2 04-24-2015 10:20 AM
Search and Replace - possible bug? PL_kolek Conversion 2 11-01-2012 06:56 AM


All times are GMT -4. The time now is 12:21 AM.


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