pawank86 has asked for the wisdom of the Perl Monks concerning the following question:
above code is appending the non-matching lines also in same file, i just want to search and replace same line.open(my $FileH,"+<$meterFile"){ while (<$FileH>) { if ($_ =~ /sdpRowId:(.*)/){ #print "$_ \t $rowId\n"; $_ =~ s/sdpRowId:(.*)/sdpRowId: <ReplaceString>/g; print $FileH $_; } } close($FileH);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to open file in Edit mode
by MidLifeXis (Monsignor) on Apr 30, 2014 at 13:15 UTC | |
|
Re: How to open file in Edit mode
by Laurent_R (Canon) on Apr 30, 2014 at 21:53 UTC | |
|
Re: How to open file in Edit mode
by GotToBTru (Prior) on Apr 30, 2014 at 12:52 UTC |