indie_campbell has asked for the wisdom of the Perl Monks concerning the following question:
input file looks like:local $/= "# input for "; while (<FILE1>) { s/1\.00/5/g if /Data\b\n/; print; }
# input for Data 1.00 0.99 0.92 1.00 -0.22 0.61
But now can i adjust the code so that it only edits 1.00 on first line only. This file goes on with Data1 Data2 etc with different pairs of lines. Thanks
20040331 Edit by Corion: Added formatting, code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Edit variables in file
by Roy Johnson (Monsignor) on Mar 31, 2004 at 15:43 UTC | |
|
Re: Edit varaibles in file
by ccn (Vicar) on Mar 31, 2004 at 14:13 UTC | |
| |
|
Re: Edit varaibles in file
by dragonchild (Archbishop) on Mar 31, 2004 at 14:30 UTC | |
| |
|
Re: Edit varaibles in file
by DamnDirtyApe (Curate) on Mar 31, 2004 at 19:11 UTC |