CSV data manipulation: Difference between revisions

Content added Content deleted
(→‎{{header|Ruby}}: Use sum method)
Line 3,755: Line 3,755:
# manipulate:
# manipulate:
ar.first << "SUM"
ar.first << "SUM"
ar[1..-1].each{|row| row << row.inject(:+)}
ar[1..-1].each{|row| row << row.sum}


# write:
# write: