From: Junkone Date: 2010-10-24T22:45:40+09:00 Subject: Re: array of arrays to file On Oct 24, 12:40 am, Brian Candler wrote: > So, what happened when you ran your script? What did it do? > > I reckon you have it inside-out, because you're re-opening the CSV file > for each row of the array, which will erase the file. > > I think you should open the CSV file once, and then write each row. > > require 'rubygems' > require 'fastercsv' > arr=[[1,2],[2,3]] > FasterCSV.open("temp.csv", "w") do |csv| >   arr.each do |row| >     csv << row >   end > end > > -- > Posted viahttp://www.ruby-forum.com/. you are right. thanks.