P
Paul Danese
Hi,
is there a simpler/more idiomatic way to append/join the contents of
multiple text files into 1 file?
this works, but i'm trying to see if there are more succinct methods.
thanks!
mynewfile =3D File.new('C:\mynewfile.txt', 'w')
@myfilenames.each do |mfn|
File.open('#{mfn}.txt') do |file|
file.each_line {|line| mynewfile.puts(line)}
end =20
end
mynewfile.close
is there a simpler/more idiomatic way to append/join the contents of
multiple text files into 1 file?
this works, but i'm trying to see if there are more succinct methods.
thanks!
mynewfile =3D File.new('C:\mynewfile.txt', 'w')
@myfilenames.each do |mfn|
File.open('#{mfn}.txt') do |file|
file.each_line {|line| mynewfile.puts(line)}
end =20
end
mynewfile.close