L
Li Chen
Hi all,
I use the following script to write a 2D array. I wonder if there is
improvement for them.
Thanks,
Li
############script##########
data_all=[
(1..10).to_a,
(1..10).to_a,
(1..10).to_a,
(1..10).to_a
]# a 2D array
File.open('test3.txt','w') do |a_f|
data_all.each do |row |
row.each {|e| a_f.print e ; a_f.print "\t"}
a_f.puts
end
end
I use the following script to write a 2D array. I wonder if there is
improvement for them.
Thanks,
Li
############script##########
data_all=[
(1..10).to_a,
(1..10).to_a,
(1..10).to_a,
(1..10).to_a
]# a 2D array
File.open('test3.txt','w') do |a_f|
data_all.each do |row |
row.each {|e| a_f.print e ; a_f.print "\t"}
a_f.puts
end
end