in reply to how to format a flat file to database table
Take a look at DBD::AnyData. It is able to be configured to read pretty much any regular flat file format and convert it to any one of a number of databases.