Created
October 26, 2011 02:47
-
-
Save bkamapantula/1315267 to your computer and use it in GitHub Desktop.
Reading files with two columns in Ruby - Day 5
This file contains 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
# read file with two columns in Ruby | |
input_file = File.new("2columns.txt", "r") | |
while(line = input_file.gets) | |
col1, col2 = line.split(' ') | |
puts col1 | |
puts col2 | |
end | |
input_file.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment