Skip to content

Instantly share code, notes, and snippets.

@drio
Created January 10, 2009 03:06
Show Gist options
  • Save drio/45360 to your computer and use it in GitHub Desktop.
Save drio/45360 to your computer and use it in GitHub Desktop.
one_f, two_f = File.new("./one.txt", "r"), File.new("two.txt", "r")
while (l_one = one_f.gets)
while (l_two = two_f.gets)
puts "#{l_one} -- #{l_two}"
end
two_f.rewind # You were missing that!!!!!!
puts "----------------"
end
[ one_f, two_f ].each {|f| f.close}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment