in reply to delete a line by a string

Pardon me for sacrelige, but if you're on unix, you could just do:
cat mydata | grep -v "my strange string" > my_new_data
(note that it's not safe to output to the same file you're inputting from)

Replies are listed 'Best First'.
Re: Re: delete a line by a string
by chromatic (Archbishop) on Apr 02, 2003 at 16:56 UTC

    Yay, my first "Useless use of cat" award! This works just as well:

    grep -v "my strange string" mydata > my_new_data
Re: delete a line by a string
by crenz (Priest) on Apr 02, 2003 at 16:57 UTC
Re: Re: delete a line by a string
by Anonymous Monk on Apr 02, 2003 at 17:52 UTC
    by this command I'm getting the exact opposit result from the one I wanted I'm getting a file that contains only the lines I wanted to delete. what good does that do?