From: Shashank Date Date: 2003-06-22T00:42:57+09:00 Subject: Re: reading text line "Shashank Date" wrote in message > f = File.open("testfile","r") > while(!f.eof) > s = f.gets > puts s > f.gets > end > f.close Two one-liners (again ignoring exception handling, of course): File.open("junk.txt","r") {|f| (puts f.gets; f.gets) while !f.eof} File.readlines("junk.txt").each_with_index{|line,i| puts line if (i % 2 == 0)}