So you have a text file that is so big that even the word count is a bit less than your computers' memory ??? Wow. Can you mail it to me ? 
Merging two results files is easy, especially if they are already sorted. Roughly something like this :
//- Open two results files
// - read a line of each file
//- until both files are completely read :
// - are the words identical ?
// - yes -> write word and the sum to your output file
// read next line in both files
// - no -> write only the word that is lowest in the alphabet to your output file
// read next line from this words' results file
//- Open two results files
// - read a line of each file
//- until both files are completely read :
// - are the words identical ?
// - yes -> write word and the sum to your output file
// read next line in both files
// - no -> write only the word that is lowest in the alphabet to your output file
// read next line from this words' results file
To copy to clipboard, switch view to plain text mode
You could speed this up by comparing e.g. 100 files simultaneously.
Maybe you could also use a MySql database, but that will probably be too slow for word counting operations. You could store the results of all the input text files in a single table, and then execute a grouping and summing SQL statement onto it. I wonder if you would hit any limitation of MySql.
Best regards,
Marc
Bookmarks