Archiv für März 2011

Import spreadsheet data into DocBook

März 19, 2011 - Markus Hoenicka
DocBook is a versatile XML vocabulary for technical documents, including grant proposals and theses in life sciences. Typing tabular data into an XML editor like Emacs + nxml is pretty cumbersome as there is a bad signal-to-noise ratio in terms of markup vs. data. In contrast, typing the same data into a spreadsheet like OpenOffice Calc is painless. Also, I'm used to keep my data in spreadsheets anyway, so I had to find a way to import these into DocBook files. Apparently there is no such tool on the market, so I dusted off my Perl skills and wrote a little script for this purpose.

Being a lazy person, I didn't build this script on Text::CSV but I rather used a lightweight approach to parse the input data. Best results are obtained if you save your spreadsheet data using tabs as column separators. As long as you don't insist on using tabs in your data as well, things will turn out fine.

See here for some more information including the download link. Maybe you find this tool as useful as I do while typing my "habil" thesis.