From: Rodrigo Bermejo Date: 2009-10-09T05:23:59+09:00 Subject: Re: find a print out a line Collin Moore wrote: > Hi > I am slowly learning Ruby and working on a solution. I have huge text > files with tons of garbage and I want to extract just specific lines > including the word 'TestPhase'. > > Looking for simple solutions, just struggling with the problem. > > Thanks in advance for advice and help. is there a famous one-liner for this ..but its not good for a learning experience. This is ok for starters. File.readlines("file.txt").each do |line| puts line if line =~ /TestPhase/ end have fun you got homework .. things to read more about: File.read* methods =~ (regular expresions) -- Posted via http://www.ruby-forum.com/.