From: "Esteban Manchado Velázquez" Date: 2005-10-13T03:32:47+09:00 Subject: Re: Removing blank lines 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.) ---------------------------------- 8< ---------------------------------- zoso@velutha:~/tmp$ cat >test one two three four five zoso@velutha:~/tmp$ ruby -e 'puts File.readlines("test").find_all {|line| line !~ /^$/}' one two three four five ---------------------------------- >8 ---------------------------------- Or you mean writing back the result to the file? In that case, I guess you'll have to write it to another, temporal file, and then move it to the original path. Regards, -- Esteban Manchado Vel�zquez - http://www.foton.es EuropeSwPatentFree - http://EuropeSwPatentFree.hispalinux.es