View Single Post
Old 06-25-2016, 02:33 AM   #4
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,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
You should be able to do this in the calibre editor. I'm not sure about Sigil or other text editors.

So, in the calibre editor...

Start by doing a tidy/reformat the code. This makes sure the layout is the same throughout the book. Put the search/replace into regex mode. Then select a sample of what needs to be changed and press CTRL-F. This takes takes the selected text and puts it into the search field. It also escapes any of the characters in the selection that need to be escaped. It also includes the line feeds that are in the selected text.

Then, change both the speakers name and the spoken text to ".*" (without the quotes) and add open and close parentheses around text.

You will end up with something like the following but on only one line in the search field:

Code:
(<p class="speaker">.*</p>

    <p class="verse">.*</p>)
The replace text is:

Code:
<div class="pageavoid">\1</div>
That should work, but I haven't tested it.
davidfor is offline   Reply With Quote