From: "Christopher D." Date: 2012-05-01T05:21:12+09:00 Subject: Re: Writing a file to txt, how can I put a new line? Sam Duncan wrote in post #1059006: > On 01/05/12 07:59, Christopher D. wrote: >> I also tried >> txt<< puts line >> txt<< "#{puts ""}" >> txt<< "#{puts line}" >> > Have you tried simply writing the whole array joined by carriage returns > to the file? > > File.open(my_log_file, "w") { |f| > f.write(my_log_array.join("\n")) > } > > Sam Actually just tried that was going to write back with a solution. You can also append to the array like this: DNErep.each { |x| txt << "\n#{x}" } Appreciate the help -- Posted via http://www.ruby-forum.com/.