Modifying cell value in csv without FasterCsv


Below is the content of my csv file

Name Rank
Antony 10
Mark 12

I have to change the rank value of Antony alone. Headers should not be
affected.I ll be happy of you people come out with solution and snippet.


without usage of fastercsv. only standard csv should be used.

ruby version: 1.8

Read each row of your csv file, and write out each row–incorporating
any changes–to another file. Delete the original file, then rename the
new file to the old file name.

For most purposes, files can be considered as unchangeable.

Hi 7stud,

1.8.7 :005 > require ‘csv’
=> true
1.8.7 :006 > CSV
=> CSV

You might also want to check out the documentation at:

Best of Luck,