Here is a really useful tool that allows you to reformat a text file using scripts. There is a free version of the tool, that you can use to take the software for a spin. The easiest method is to open one of the sample files and tweak it to do something you need it to do.
Still looking for other tools which might be simpler that P-o-matic. Untill then this will safetly be tucked into my toolbox.