in reply to Long list is long
Since (as I'm reading it . . .) the ordering is determined by the final sum of all values from the different files I'd try to leverage DBI and an sqlite DB. Read each file into a table with word and cur_sum columns updating the latter with each word's value. Once you've read all files then use a SELECT word, cur_sum FROM foo ORDER BY cur_sum DESC to pull out the final results.
Alternately DB_File could be done used to do something similar to create a summed values file (read each input file and increment the counts in the tied DB; then walk the keys of the DB to create an (unsorted) output file) and then you could try using sort(1) to create the final file from that. If that is too much for your box then use split (or write multiple files), sort those component files, then write an aggregator to merge those (implement the merge of merge sort: read one line from all the (now sorted) sub-files, output the highest and replace it, lather rinse repeat).
EDIT: wording. ENOCAFFEINE.
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|