From: 7stud -- Date: 2012-12-17T15:12:41+09:00 Subject: Re: print - and strip text between tags using Nokogiri 7stud -- wrote in post #1089314: > > I forgot to mention. There are several ways to read line by line from a > file, Here are some others: f = File.new(fname) f.each do |line| line = line.chomp end f.close ==== File.open(fname) do |f| while line = f.gets #gets() returns nil at eof ... end end #file is automatically closed here -- Posted via http://www.ruby-forum.com/.