Hello!
Here is what I am trying to do: I am taking a class at school that is using a lot of literature that is in the public domain, and available for free on the web. Rather than read them online in HTML, I have been pulling them down and quickly and dirtily tagging them up and typesetting them with LaTeX.
I am pulling down a piece of work that has a lot of end notes, and i would like to write a script so that I can add all of the \endnotemarker and \endnotetext tags relatively automatically.
All of the notes are already numbered appropriately, but not tagged.
What I would like to do, with either Perl or SED or AWK or VI or whatever would be best... is search for all integers and then apply the tag before an after it. The problem I am running into, is that my search term is something like
* [0-9]+ #to find in text numbers
^[0-9]+ #to fine end note numbers
but, obviously, if I use a replace term, it is not going to use the number that was found, but literally whatever I write in the replace term (this is all in VI right now, sorry I was not clear).
This is why I think I need some kind of a script that will find the number, store the number in a variable and then I can call upon that specific variable in the replacement term. The variable would update each time a new integer is found.
I might thinking about this all wrong, but can anyone think of a simple way to do this? It is not life and death, it would just make the file I generate something worth keeping around for re-reading.
Thanks!
EDIT: now that I think about it, I dont think this will really work for the LaTeX operation, but does anyone know how to write a script to do this in general... like if I wanted to add a word after every time a number appears in a paragraph, without changing the number?