Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: String Search/Replace

by chester (Hermit)
on Aug 31, 2005 at 14:57 UTC ( [id://488128]=note: print w/replies, xml ) Need Help??


in reply to String Search/Replace

Without using split (I think this is the shortest so far too...):

perl -ple "s/(?<!^)\b(\d+)/$1>1000?0:$1/eg" filename
edit: Nope, see below. :)

edit2: Never mind...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://488128]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-26 01:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found