in reply to Writing to many (>1000) files at once

Looking at it from another side: is there a way you can sort your customer file on the "customer" field? Assuming that each customer get his/her own output file you could then sequentially go through the customer file an put together the output file. In that way you have only one file open for output at the same time. Depending on how your files are organized it might mean that you will have to go through the data file too many times and that this is the real bottleneck.

I still think a database-solution would work best.

BTW: what is the source of all this data? If it is already in a database, cannot you run some queries to get directly at the data?

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

  • Comment on Re: Writing to many (>1000) files at once