I have a CSV that I parse where I am trying to find a certain row and update a certain column within it. So far I have been able to come up with the query below to find the specific rows that I want to update. But I don't know how to update the csv after this.
So far I have:
csv = CSV.parse(csv_table, :headers => true)
get_persons.each do |person|
record = csv.find{ |row| row['Email'] == person.email }
puts record[5]
end
I am able to find the rows that I want to update from the CSV but the problem that I'm stuck on and can't find any help is how do I then update the column for that row that is found (specifically column 6 = record[5]) and add that back into the CSV so that it updates?
Any help would be great, thanks!