View Single Post
Old 09-28-2014, 05:10 PM   #13
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by jbacelar View Post
First, sorry for my horrible English.

What I do to renumber notes.
Required:
The text in question in a single file. In your case put behind each "Chapter" a character that does not exist in the original file. For example @.
Phyton 2.7 installed.
Run the py, which attached, in the folder where the file is.
And that's it!

Note:
Change the extension "Renumerar notas.txt" a "Renumerar notas.py".
Of course, first you have to tune the py your needs. (With any text editor).
n = start counter. (Usually 0)
i = increased. (Usually 1)
regex = search the strange character. In this case: re.compile (r "(@)")
files = ["file name"]
The file extension (shown as html), you put the need.

I hope you find it useful.
Perhaps you'd like to turn that into a Sigil plugin?
eschwartz is offline   Reply With Quote