From: Stephen Smith <4fires@...> Date: 2007-05-18T09:22:00+09:00 Subject: Re: addin lines to existing csv file with fastercsv > It doesn't add additional lines, i pasted te code below, has anyone a > suggestion how to write new lines? You need to insert newlines after each record string. For example: hdr = [['field1a', 'field1b'], 'field2', 'field3', 'field4'].flatten.join(',') FasterCSV.open("my_csv_file.csv", "w") {|file| file << hdr + "\n" # There's a different newline thingamajigger for Windows: \r\n # proceed with adding additional records here. } > > > require 'fastercsv' > > > FasterCSV.open("d:/file.csv", "w") do |csv| > csv << [@params[:ha_gewas2], "first name", "last name", "email"] > end > > -- > Posted via http://www.ruby-forum.com/. > >