This is from the Linux Documentation Project, for which I write and help out from time to time. Binh Nguyen, author of the Linux dictionary, wanted a way to convert his text file, containing thousands of Linux-related words, together with their definitions, to DocBook XML.
The input file contains entries, separated by blank lines. The word and its definition are separated from eachother by tabs:
Word definition in very long line word long line otherword more longline testword looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong line, but i mean really looooooooooooooooooooooooooooooooooooooooooooooooooong.
The output should look like this:
<row> <entry>Word</entry><entry>definition in very long line</entry> </row> <row> <entry>word</entry><entry>definition in very long line</entry> </row> ...
Click here for a possible solution.