Emptying a CSV file and starting fresh daily
Posted: Wed Apr 12, 2006 3:04 pm
I apologize if this has been asked before but I found no trace of this in the search.
I have a form that a customer fills out that emails data to the site owner and also appends itself to a CSV file on the server. Up to now, the CSV file emails itself to the owner daily. The problem is that the data is always appended to the CSV file and all of the old data is there each day.
Is it possible from PHP to "purge" the CSV file after it's been sent so that it contains only new data? I have limited access to the server so I can't delete the file and have it generate a new one. I need the current file to just empty itself and start over. Does that make sense?
I have a form that a customer fills out that emails data to the site owner and also appends itself to a CSV file on the server. Up to now, the CSV file emails itself to the owner daily. The problem is that the data is always appended to the CSV file and all of the old data is there each day.
Is it possible from PHP to "purge" the CSV file after it's been sent so that it contains only new data? I have limited access to the server so I can't delete the file and have it generate a new one. I need the current file to just empty itself and start over. Does that make sense?