Hi,
I've got a weird issue with Ruby. I want to read data from a file and put the data then into an array. The weird thing is, it's working in another script which does basically, the same thing.
quoteArray = []
quoteFile = File.new("quotes.txt", "r") or die "Unable to open file..."
quoteFile.each_line { |line| quoteArray.push line }
puts quoteArray[0]
All I get out of this is an array with one element where the whole text file is in. What's wrong? Is it my machine? The text file? Any ideas?
Thanks in advance