From: "robertgleeson (Robert Gleeson)" Date: 2013-07-25T07:21:13+09:00 Subject: [ruby-core:56162] [ruby-trunk - Feature #8683] CSV library can't append to the current row. It should be able to. Issue #8683 has been updated by robertgleeson (Robert Gleeson). I guess I could settle for: headers = ["one"] CSV.generate headers: true do ["two", three"].each do |e| headers << e csv << headers end end but, this is preferable: headers = ["one"] CSV.generate headers: true do ["two", three"].each do |e| csv.append_to_current_row(e) end end ---------------------------------------- Feature #8683: CSV library can't append to the current row. It should be able to. https://bugs.ruby-lang.org/issues/8683#change-40654 Author: robertgleeson (Robert Gleeson) Status: Open Priority: Normal Assignee: Category: Target version: The CSV library can only add *new* rows, and it provides no way to update the current row after it has been created. For example: CSV.generate headers: true do |csv| csv << ["one"] ["two", "three"].each do |e| csv << e # This creates a new row, I want to append. end csv.headers << ["two", "three"] # No, this doesn't work either. end Is this possible? I find it hard to believe the API could be _that_ limited and inflexible. -- http://bugs.ruby-lang.org/