From: timsuth@... (Tim Sutherland) Date: 2005-01-30T17:35:49+09:00 Subject: Re: Why csv file processing is so slow? In article <1107042295.816570.61420@z14g2000cwz.googlegroups.com>, mepython wrote: [...] >How hard to do reverse: create csv string from list? > >Thanks. I just started Ruby couple of days ago, so I am learning >instead of implementing, Sorry. This assumes the input is an array of lines. (Where each line is an array.) class Array def to_csv map { |line| line.map { |cell| '"' + cell.gsub(/"/, '""') + '"' }.join(',') }.join("\n") end end Note that literal quotes " are replaced with "".