Chris wrote:
I need some help with this problem.
I've got a text file datafile with 1 line of data comprised of 30
different numbers delimited with ~s.
I need to open this file, grab this line of data, split it into
individual numbers, perform some simple math (addition) on each
number, and then put the new values back into the datafile, replacing
the original data that was there.
perl -i.bak -pe's/(\d+)/ $1 + 3 /eg' yourdatafile
John
--
The programmer is fighting against the two most
destructive forces in the universe: entropy and
human stupidity. -- Damian Conway
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/