A
Al Cholic
Hello,
Im attempting to analyze a text file, but having trouble splitting it up
into lines (into an array that indexes each line). Then I would like to
print every line.
Here is what I got:
f = File.open("/Users/john/Desktop/text.txt")
f_lines = f.split("\n")
puts f_lines
And here is the error Im getting:
NoMethodError: private method ‘split’ called for
#<File:/Users/john/Desktop/text.txt>
Dont know why this isnt working. Should be simple enough...
Can someone help please?
Im attempting to analyze a text file, but having trouble splitting it up
into lines (into an array that indexes each line). Then I would like to
print every line.
Here is what I got:
f = File.open("/Users/john/Desktop/text.txt")
f_lines = f.split("\n")
puts f_lines
And here is the error Im getting:
NoMethodError: private method ‘split’ called for
#<File:/Users/john/Desktop/text.txt>
Dont know why this isnt working. Should be simple enough...
Can someone help please?