Writing to csv file

I have to load testing following scenario

Purchase - thread group,
Each registered user reads a row(contains login id, product details, card details) from CSV file, it logins to a site, finds a particular product, checks it makes a payment and and logs off

Before thread group can be run, CSV file needs to be populated with list of registered users

For creating registered users, I have created another thread group - CreateUsers(mainly a script to create loading testing data), which basically reads the same csv file as above, it picks up login id and password and creates users in the site
which will be used by next group -Purchase group

While crating users, It want to check response, if user creation successful, I want to have a column "SuccessfulCreation" in the csv file to be set as "Y"

Purchase group will then read csv file and then pick only those rows, which has column "SuccessfulCreation" set as "Y"

How to read CSV file and write back only a value(coloumn) to the read row of the csv file

Thanks in advance