Created
February 6, 2011 23:15
-
-
Save tatiC/813809 to your computer and use it in GitHub Desktop.
ruby strange output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p1 = File.open('people1.txt').readlines | |
p2 = File.open('people2.txt').readlines | |
puts p1 - p2 | |
=begin | |
ruby-1.9.2-p136 :006 > f1 = File.open('people1.txt').readlines | |
=> ["tatiana\n", "ana lucia\n", "sergio ney \n", "marco aurelio \n"] | |
ruby-1.9.2-p136 :007 > f2 = File.open('people2.txt').readlines | |
=> ["tatiana\n", "cantido \n", "marco aurelio\n", "renata"] | |
ruby-1.9.2-p136 :008 > f3 = f1 - f2 | |
=> ["ana lucia\n", "sergio ney \n", "marco aurelio \n"] | |
ruby-1.9.2-p136 :009 > f4 = f2 - f1 | |
=> ["cantido \n", "marco aurelio\n", "renata"] | |
ruby-1.9.2-p136 :010 > f1 = File.open('people1.txt').readlines | |
=> ["tatiana\n", "ana lucia\n", "sergio ney \n", "marco aurelio \n"] | |
ruby-1.9.2-p136 :011 > f2 = File.open('people2.txt').readlines | |
=> ["tatiana\n", "cantido \n", "marco aurelio\n", "renata"] | |
ruby-1.9.2-p136 :012 > f3 = f1 - f2 | |
=> ["ana lucia\n", "sergio ney \n", "marco aurelio \n"] | |
ruby-1.9.2-p136 :013 > f4 = f2 - f1 | |
=> ["cantido \n", "marco aurelio\n", "renata"] | |
=end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment