0

I am trying to read csv file uploaded to s3 server, then modify its content and then write it back to the server. For reading i am using the following code..

object=bucket.objects['test.csv'] url= object.url_for(:read, :expires => 10*60, :secure => true) urlw= object.url_for(:write, :expires => 10*60, :secure => true) csv_file = open(url,'r') @dealers = SmarterCSV.process(csv_file)

Then i want to modify a record and write it back to CSV. How can i achieve this. Also if i want to delete a record.

Manish
  • 108
  • 10
  • You can create a new csv file by programmatically manipulating `@dealers` object - taking care of modifying / deleting individual rows. Later on overwrite the original file with the new one. – Prakash Murthy Dec 20 '14 at 17:17
  • Can you show some example code. – Manish Dec 22 '14 at 09:48

0 Answers0