I have the following code:
f = File.open("/log/mytext.txt")
f.each_line do |i|
i = i.delete("\n")
puts i.inspect
The delete gets rid of the \n, but the result looks like this:
"#<MatchData \"line1\">"
""
""
""
"#<MatchData \"line2\">"
Want it to return :
line1
line2
Been fighting this problem all day. Thanks for your help