ryan(ma) has asked for the wisdom of the Perl Monks concerning the following question:
Perhaps you can help me. I'm trying to format a book for display on an e-Reader. The original is html. In the original there are footnotes in the text. The footnote number in the main body points to the footnote text through a hyperlink. The text of the footnote is in a different file.
What I'd like to do is this:
To give an example:
The main body text looks like this:
some words<a href="different_file.html#note1">1</a>The footnote text looks like this:
<a id="note1">Here is the footnote text.</a>I can write a regular expression to pull out the footnote text from the above string. And I can write another regexp to insert that text in the appropriate place in the main body. But I don't know Perl. There are hundreds of footnotes and it would be great to automate the process.
The reason I want the footnote text in the main body is because I'm using Latex to create the book, and that's the best way to reference footnotes in that program.
I hope this makes sense. If there's a convenient way to do this, I'd appreciate any help.
Thanks! best wishes, Ryan
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: multiple search/replace across multiple files
by moritz (Cardinal) on Jun 06, 2011 at 14:47 UTC | |
|
Re: multiple search/replace across multiple files
by kennethk (Abbot) on Jun 06, 2011 at 20:36 UTC |