Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 12-15-2017, 03:44 PM   #1
1v4n0
Groupie
1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.
 
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
Replace reoccurring string with increasing number

I got an epub of poetry where each verse is in its own specifically classed paragraph. Is there a quick way to add verse numbers before each paragraph? So to pass from

Code:
<p class="verse>Tu non altro che il canto avrai del figlio,</p>
<p class="verse>o materna mia terra. A noi prescrisse</p>
<p class="verse>il fato illacrimata sepoltura</p>
to

Code:
<p class="verse-number">1</p><p class="verse>Tu non altro che il canto avrai del figlio,
</p>
<p class="verse-number">2</p><p class="verse>o materna mia terra. A noi prescrisse</p>
<p class="verse-number">3</p><p class="verse>il fato illacrimata sepoltura</p>
Thanks.
1v4n0 is offline   Reply With Quote
Old 12-15-2017, 04:04 PM   #2
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
You could use the Function mode in Calibre Editor or my simple Incremental IDs Sigil plugin.
(With my plugin you'd first have to add incremental ids and then use a regex to change the ids to tag values.)

BTW, if using epub3 books is an option for you, you could also use CSS with pseudo selectors to add line numbers. For details see this thread.

Last edited by Doitsu; 12-16-2017 at 01:26 AM.
Doitsu is offline   Reply With Quote
Advert
Old 12-16-2017, 03:55 AM   #3
1v4n0
Groupie
1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.
 
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
Ops, turns out I had already asked the same question three years ago
1v4n0 is offline   Reply With Quote
Old 12-17-2017, 03:50 AM   #4
fbrzvnrnd
Fanatic
fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.
 
Posts: 554
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
You can also use a XQuery script
fbrzvnrnd is offline   Reply With Quote
Old 12-17-2017, 05:35 AM   #5
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by fbrzvnrnd View Post
You can also use a XQuery script
Could you please give an example?
Doitsu is offline   Reply With Quote
Advert
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fin/ replace a generic string keele Editor 4 09-19-2014 03:46 PM
Replace field with match or empty string? charlweed Library Management 2 03-29-2012 12:44 AM
Regex - replace only part of a string - how? flameproof Sigil 11 02-23-2012 04:43 AM
search and replace with incremental number pimpoum General Discussions 4 07-08-2011 02:41 PM
Find and replace string with wildcard jhempel24 Sigil 15 11-12-2010 01:50 PM


All times are GMT -4. The time now is 05:16 AM.


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