Then just put them in a database and write a simple SQL query. If you use Perl it’s really very simple to do.