in reply to Re^3: Search and replace next line
in thread Search and replace next line
and run it as "perl replace_test.pl Compiler_Setup.ini". If the output looks okay, use "perl -i replace_test.pl Compiler_Setup.ini"while (<>) { print; if (m/Gimpel PC-Lint for H8\]/){ # read the line to be replaced my $line = <>; # do something with it $line =~ s/1/0/; # print the new version print $line; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Search and replace next line
by Anonymous Monk on Jan 05, 2005 at 12:19 UTC | |
by perlnewbie2000 (Initiate) on Jan 05, 2005 at 12:29 UTC |