lammert - 7:56 am on Nov 6, 2010 (gmt 0)
This looks something which can be accomplished with AWK. AWK is a streaming scripting language which takes an input file one line at the time and performs actions based on the contents of that line. I have generated files with it in the past.
What kind of input date are you expecting to use, are the unique words in a text file two words per line, or is there another format to process?