Ruby 1.9 version of csv
header %w[first second third]
data = ["column one",,"column three"]
CSV.open("myfile.csv","w") do |csv|
csv << header
csv << data
end
In this simple example, the empty middle ,, in the data array causes an error but if empty quote are used ,"", then no error and the CSV file is created. However I want to make the CSV file not have an empty quoted segement.
Specifically how do I generate blank sections of a CSV file without quotes? Data could be empty variables but it should still write the commas.