Using smarts saves time
Wheew, what a relief. No, Obama hasn’t changed course, nor did Dick Cheney experience a fatal hart attack. I just managed to solve my problem through wits and cunning. I’m posting this mostly for myself, so I may remember how to deal with this the next time.
I have a 35 page (that’s A4 pages) of scientific references that I need to publish on a website dedicated to subterranean amphipods. Posting references is so special because I need to add custom tags before and after each paragraph so that the references are indented, which makes them easier to read. I also needed to add html tags before and after each italicized word (species names).
I started digging into the world of writing an OpenOffice.org macro, which could quite elegantly solve my problem. Snag number one: I’m not experienced in BASIC (which is the programming language used). A pretty big snag, I would say. I then again did it all wrong and first posted a question on Stack Overflow and then started browsing for answers (I should have done the other way around). After 10 seconds of browsing the Stack Overflow, the answer struck me out of the blue.
What I did was I saved the file in .XML. What this does is basically save all the information on the page ready to be posted on the internet. Which means every paragraph is defined, all bold, italicized and underlined elements are recognized and so forth… It was then just a matter of Find and Replace to switch the default XML tags (tags like P and I) to my custom tags. Voila!


