From: Dave Thomas Date: 2002-03-04T23:23:24+09:00 Subject: Re: Load a Text file (newbie) "Douglas J van Vliet" writes: > Is there a way of loading a text file in memory and then accessing the lines > one at a time? # this opens, reads, and closes content = File.open("/etc/passwd") {|f| f.read} # this goes through it line at a time content.each do |line| puts line end In Ruby 1.7, you can write the first step as content = File.read("/etc/passwd") Dave