On Oct 8, 4:07 ¨Âí¬ Ìé Ãèåî ¼ãèåîß®®®Àùáèïï®ãïí¾ ÷òïôåº > data_all=[ > (1..10).to_a, > (1..10).to_a, > (1..10).to_a, > 1..10).to_a > ¨Â²Ä áòòá> > File.open('test3.txt','w') do |a_f| > ¨Âáôáßáìì®åáãè äï üòï÷ > row.each {|e| a_f.print e ; a_f.print "\t"} > a_f.puts > ¨Âîä > > end I would do something more along the lines of this: File.open('test.txt', 'w') do |file| data_all.each do |row| file.puts row.join("\t") end end On Oct 8, 10:09 pm, botp <botp... / gmail.com> wrote: > you may want to look at fastercsv. > > kind regards -botp This is tab-separated, but if Excel is the ultimate goal, I guess that CSV would work. Fortunately, I don't use Excel, so I don't know much along those lines.