Hi guys, I wanna pick some brains if possible? I'm going to email a campaign using mailchimp contacts retrieved from a CSV file. The Mailchimp campaign is intended to verify the customer details within the CSV Database. Here follows the tricky part: The fields displayed in the email will be such like name, email, telephone number, and if the contact details are ok, it will require no further actions from the user. However, if the details are not correct, I want to forward the user from the email to a landing page on our site. The site will populate the exact same fields (retrieving from the email fields) and allow the user to overwrite their incorrect details, before saving to/overwriting the original CSV database. I wonder if any whizzes on here can tell me how difficult a task that is? Thanks in advance! Jamie
You can't edit a text file (which is what a csv file is) in place. You have to read the entire file, change the data in the row that has to be changed, then write out the entire file. How difficult? Trivial if you know how to read and write files (and develop web pages), impossible if you don't.
Hi Rukbat, I have a fair amount of exp. deveoping web pages using (for instance) MYSQL and the like. But not overwriting CSV files. So any help/pointing in the right direction would be much appreciated!
Just as I said - read the entire file - into an array of lines or a single string, your choice. Make whatever changes you want. Open the file for write (deleting everything in it) and write the text out to the file.