Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^4: Remove zero padding from excel mangled Ip addresses

by raybies (Chaplain)
on Mar 22, 2012 at 14:44 UTC ( #961036=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Remove zero padding from excel mangled Ip addresses
in thread Remove zero padding from excel mangled Ip addresses

Beautiful!

Testing this one, the only possible unexpected output I had was when I had a bareword (not a dotted quartet) that was all numbers with leading 0's.

input:>

040.300.000.048,00145,010.030.000.049,CDU00U04V43

Output:>

40.300.0.48,145,10.30.0.49,CD00U04V43

Which I think most of us would agree is acceptable, assuming the second field is a raw integer value, and not intended to be a code that requires leading zeroes preserved. The nice thing is the word (last field) is preserved.

Nice, anyhow, thanks for sharing your expertise.


Comment on Re^4: Remove zero padding from excel mangled Ip addresses

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2014-10-02 07:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (50 votes), past polls