in reply to Re^2: update values in one file from another
in thread update values in one file from another
This only works the first time it's run, after that everything that isn't in $fed{1} is always only set to 1. I was trying to get it to increment all other values by 1 each time and set the $fed{1} values to 0local @ARGV = ('file1.txt'); local $^I = '.bak'; while (<>) { m/^(\w+)\s+(\d+)$/; printf "$1\t%d\n", not exists $fed{$1} ? $2+1 : 0; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: update values in one file from another
by Anonymous Monk on Dec 08, 2005 at 10:39 UTC |