"Shashank Date" <sdate / everestkc.net> 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)}