Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
col1 = []
col2 = []
col3 = []
col4 = []
col5 = []
File.open("C:\\Documents and Settings\\Desktop\\test.txt", "r") do |infile|
while(line = infile.gets)
numbers = line.split(/\s*,\s*/)
col1 << numbers[0].to_i
col2 << numbers[1].to_i
col3 << numbers[2].to_i
col4 << numbers[3].to_i
col5 << numbers[4].to_i
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment