Hi, it is not quite clear, how consistent your search and replace patterns are. But if they are, BBEdit's Canonize-command could deliver an easy solution.
In a nutshell: You can use a simple text file as a search-replace dictionary (think of a text based key-value array). Each line in such a textfile would have the simple form: searchterm<tab>replaceterm So with your example a line might look something like this: _ftnref19 <pb_endnote>See Werner G. Marx, "Money Matters in Matthew," <i>Bibliotheca Sacra</i> 136:542 (April-June 1979):148-57.</pb_endnote> In Endnote you should be able to set up an export filter (or are those called Styles? I have not used Endnote for years) – but it should not be too dificult to assemble a custom text file that you can use as a lookup table with Canonize. Canonize is a pretty powerful feature. You can even use grep patterns in those files. Be sure to check out the fine manual to learn more about them. Regards, Roland On Fri, May 14, 2021 at 9:05 PM Cooper Cavalier <[email protected]> wrote: > I have a text/html file which has thousands of endnotes. The file has the > inline endnote reference as [1], [2], [3], etc. which correspond to the > appropriate endnote. For the app publisher I am working for, the endnotes > must be placed in line with specific coding. > > I am totally stumped in finding a way either inside of Bbedit or using a > Python script. I am doing this editing on a Mac. > > *Currently the inline link looks like this:* > <p>It has been estimated that about one-fifth of Jesus' teachings was > about money matters.<sup><a href="#_ftn19" name="_ftnref19">[19]</a></sup> > > *The endnote looks like this:* > <h3 pb_toc=index><a href="#_ftnref18" name="_ftn18" > title="">[18]</h3><sup>[18]</sup></a>See Werner G. Marx, "Money > Matters in Matthew," <i>Bibliotheca Sacra</i> 136:542 (April-June > 1979):148-57. > > *It needs to instead look like this:* > <p>It has been estimated that about one-fifth of Jesus' teachings was > about money matters.<pb_endnote>See Werner G. Marx, "Money Matters in > Matthew," <i>Bibliotheca Sacra</i> 136:542 (April-June > 1979):148-57.</pb_endnote> > > Any help would be deeply appreciated since there is no way I can do this > manually. > > Thank you! > > Doug > > > -- > This is the BBEdit Talk public discussion group. If you have a feature > request or need technical support, please email "[email protected]" > rather than posting here. Follow @bbedit on Twitter: < > https://twitter.com/bbedit> > --- > You received this message because you are subscribed to the Google Groups > "BBEdit Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/bbedit/5a5f865a-c7d9-4b55-8f2d-0fbdef43d406n%40googlegroups.com > <https://groups.google.com/d/msgid/bbedit/5a5f865a-c7d9-4b55-8f2d-0fbdef43d406n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "[email protected]" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit> --- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/CABybPXaA8zumBdr_H06Yy-NLKiSzmgUSi58F2Cp9fWV1D1-MUA%40mail.gmail.com.
