in reply to opinion - enormous input files
I would read each line one at a time and use a hash to keep track of how many occurrences there are for each string.
And you didn't even know bears could type.