I don't have any more ideas about the memory issue. If it were my project, I would save each set of results as XML. In fact, you can set up results once, and save the file as XML to get the framework. Then, use that as a template to write out each text file.