#!/usr/bin/perl use strict; use warnings; #psudo code from here on # open the file with categories # read the categories in (probably to a hash where the key is the category and the value 0) # close the categories file (you have your hash, you don't need to read from the file anymore) # open the file with 3000k entries # read the file line by line # for each line read # trim to the first 8 characters # look for that value in the hash keys # increment the value of the hash key that is matched if any # you now have a hash with category as the key, and the number found as the value # you should be able to figure out how to find the top 100 values and print out the key and value for each of them or store them to file