From: Stefan Lang Date: 2005-10-13T03:42:15+09:00 Subject: Re: Removing blank lines On Wednesday 12 October 2005 20:32, Esteban Manchado Vel�zquez wrote: > Hello Basi, > > On Thu, Oct 13, 2005 at 03:26:52AM +0900, basi wrote: > > Hello, > > How does one delete blank lines from a text file? (I did try a > > number of things, but, I can't get any to work.) > zoso@velutha:~/tmp$ ruby -e 'puts File.readlines("test").find_all > {|line| line !~ /^$/}' similar: ruby -e 'puts File.read("test").gsub(/\n{2,}/, "\n")' Regards, Stefan