in reply to formating the record

You might be interested in Text::Table.