How to open, write data to and close a new file for each step of a loop.
Hi everyone,
I'm having a problem with a program I'm writing. I'm doing a numerical simulation, and as part of the simulation, I need to output a data file for every timestep, or later output the data of ten timesteps to a data file etc.
The problem is that I would like to be able to vary the filename in each iteration of the loop in a counter fashon.
For example data 1.dat
data 2.dat
and so on.
I was wondering if anyone knows a way that this can be accomplished.
All help you can give is very welcome and will be greatly appreciated.
Thanks,
Wayne.