I have the following code:
f = File.open("/log/mytext.txt")
f.each_line do |i|
i = i.delete("\n")
puts i.inspect
Removing gets rid of \ n, but the result is as follows:
"#<MatchData \"line1\">"
""
""
""
"#<MatchData \"line2\">"
Want him back:
line1
line2
Fighting this problem all day. Thank you for your help.
source
share