in reply to String Search/Replace
perl -ple "s/(?<!^)\b(\d+)/$1>1000?0:$1/eg" filename [download]
edit2: Never mind...