From: Tobias Reif Date: 2002-05-06T19:44:07+09:00 Subject: Re: newbie Q: how to strip blank lines from file? David Alan Black wrote: > fout = File.open("snip.out", "w") > File.open("snip.txt").each do |line| > fout.print line if /\S/.match(line) > end I'm not sure, but shouldn't snip.out get closed? Should the following work? open("snip.out", "w") do |out| open("snip.txt").each do |line| out.print line unless /^\s+$/.match(line) end end Tobi -- http://www.pinkjuice.com/