TFMT - A table formatting tool
TFMT is a fairly clever equivalent to the standard UNIX tool fmt. It formats ASCII tables in files or from STDIN. It can also be used as a filter with vi or EMACS to process a part of an editor buffer.
TFMT is written in Perl and requires version 5.003 or higher. You can have a look at the TFMT man page or grab the complete TFMT program (which contains the man page in POD format)