IO.readlines( 'file.txt' ).delete_if{ |line| line =~ /^!.*!$/ }
#=> returns an array; you may want to .join it with the newline
seperator.
···
On Jan 12, 6:37 pm, "itsme213" <itsme...@hotmail.com> wrote:
I have a file of code that has "!"-delimited lines and other non !-delimited
lines. I want to remove all the "!"-delimited lines!some stuff that i do not want!
lots of other stuff that i want
lots of other stuff that i want!some stuff that i do not want!
lots of other stuff that i want
lots of other stuff that i wantWhat would be a simple ruby script to use regex and remove all the
!....!