Hi,
What is the best way to append the content from one file to another
file?
Thanks!
Hi,
What is the best way to append the content from one file to another
file?
Thanks!
On Fri, May 28, 2010 at 10:34 AM, John Wu [email protected] wrote:
Hi,
What is the best way to append the content from one file to another
file?Thanks!
Posted via http://www.ruby-forum.com/.
Just open the file in append mode, and write the contents of the file
you want to append to it.
eg:
to_append = File.read(“foo.txt”)
File.open(“bar.txt”, “a”) do |handle|
handle.puts to_append
end
Alex
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs