in reply to In-place file filtering
should be (note ; => ,)warn "*$zip*"; next unless
Also, you're not printing the good value back out. I would do something like:warn "*$zip*", next unless
Note: This code is lighly tested! YMMVperl -pi.bak -e 'chomp;my($x,$y)=split/\t/;do{warn"*$y*\n";next}unless +$y=~/^\d{5}$/&&$y>713&&$y<99930;print"$x\t$y\n"' *.dat
Update: Heh - really lightly tested. My code works if you change -p to -n. Ignore me. :-)
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
---|