Re: deleting a line with a particular string.

2001-06-28 Thread Me
> I have a file having 100 lines. > I want to remove the lines, having a particular string, completely from the > file. (notreplacing them with blank lines even) > > Is there a way in perl for doing this ? At a shell prompt / command line, enter: perl -ne '/string/ or print' file where stri

RE: deleting a line with a particular string.

2001-06-28 Thread John Edwards
$original = "c:\\myfile.txt"; $changed = "c:\\mynewfile.txt"; $searchfor = "john"; # Text identifying line(s) you want removing open IN, $original or die "Can't open $original: $!"; open OUT, ">$changed" or die "Can't create $changed: $!"; while() { print OUT unless /$changed/; } close

RE: deleting a line with a particular string.

2001-06-28 Thread Ronald J. Yacketta
> I have a file having 100 lines. > I want to remove the lines, having a particular string, > completely from the > file. (not replacing them with blank lines even) > > Is there a way in perl for doing this ? most defiantly, tho I am a novice at perl right now. I have sent this to the beginner