in reply to process multiline text and print in desired format
TIMTOWTDI ...
... e.g. you could adapt this flip-flop solution to your needs.
with
HTH :)
Cheers Rolf (addicted to the Perl Programming Language :) Wikisyntax for the Monastery