Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Increment a string with letters and numbers

by hdb (Prior)
on Mar 28, 2013 at 09:00 UTC ( #1025909=note: print w/replies, xml ) Need Help??

in reply to Increment a string with letters and numbers

More or less same procedure as yours but in one expression. Probably not much of an improvement...

while(<DATA>) { s/(\D+)(0*)(\d+)/sprintf("%s%07d",$1,$3+1)/e; print; } __DATA__ EVO:0000023 EVO:0000099 EVO:0010099 EVO:9999999

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025909]
LanX predicts problems for Erix next time he lines up at an US immigration counter
[erix]: but tuesdays just as bad
[erix]: thanks for the heads-up but that's a line-up studiiously avoided :P
[LanX]: yeah too far for someone who can't even make it to Amsterdam
LanX looking for a good magit tutorial
LanX ... and git in general
[erix]: I've been to Amsterdam before you were born
[LanX]: 1899?

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (12)
As of 2017-08-18 13:19 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (302 votes). Check out past polls.