in reply to Re^2: database sorter script
in thread database sorter script

Then you'll have to go through the records, using grep if you want to filter the whole list at once, or using if if going through them one at a time.

Assuming you have a hash per record:

This is pseudocode, you must fill in the details on how to get the data from the flatfile, yourself.