From: Brian Candler Date: 2008-10-25T23:03:17+09:00 Subject: Re: Join all text files in a folder, with a single line of Ruby code William James wrote: > "We still don't need no stinkin' loops!" > > File.open("mrg","w"){|f|f.puts Dir['*.txt'].map{|nm|IO.read nm}} Note that 'puts' will add a newline to the end of each file which doesn't already have one. If you don't want this, use 'print' or 'write' instead. -- Posted via http://www.ruby-forum.com/.