Ruby CSV manipulation

Read Link to heading

file = CSV.open('path/to/file.csv', col_sep: ',')
file.each do |line|
  pp line
end

Write Link to heading

header  = ['A', 'B', 'C']
content = [[1, 2, 3], [4, 5, 6]]

csv = CSV.generate do |output|
  output << header

  content.each do |item|
    output << item
  end
end

File.write('result.csv', csv)