Writing to a file normally replaces the contents of the file. That
could be your problem. Although without any more information it is difficult to be certain.
I'd suggest that you attack your problem in stages.
- Create a file using your favourite editor
- then get your code to read the data in.
- Then look at how you can modify the contents of the file
graeme