From: "Jan E." Date: 2012-08-13T03:35:44+09:00 Subject: Re: Delete a lines from a files Guys, you really need to stop wanking off over your great Ruby skills and maybe post a solution that an average user can actually understand and integrate in his code. We all know you are the greatest Ruby hackers on earth with the fanciest one-liners ever. But I think we're here to help and not to masturbate all day long. What about a simple solution? old_file = 'test.txt' new_file = 'test2.txt' File.open new_file, 'w' do |file| # loop over the lines of old_file and wrote those # not beginning with "john" to new_file File.foreach old_file do |line| file << line unless line.start_with? 'john' end end -- Posted via http://www.ruby-forum.com/.