> 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
$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
> 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