in reply to sorting flat file databases

A really good resource for this is File::Sort. You can use it to sort your file, separating your columns with anything you want, and it does most of its work very efficiently in terms of memory consumption.
--
Love justice; desire mercy.