mmittiga17 has asked for the wisdom of the Perl Monks concerning the following question:
Hi All, I am trying to increment the following number in Perl but it wont do it: AA825944001 --> AA825944002
I have tried the following and it does not work, it returns 1
$TranNum= $fields[12] +1; $fields[12] =~s/$fields[12]/$TranNum/g;
I assume it has to do with the alpha characters, but I have thousands of numbers in a column that I need to increment by 1. Any help will be appreciated.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: incrementing a number
by toolic (Bishop) on Oct 12, 2010 at 16:23 UTC | |
Re: incrementing a number
by chromatic (Archbishop) on Oct 12, 2010 at 16:23 UTC | |
Re: incrementing a number
by choroba (Cardinal) on Oct 12, 2010 at 16:24 UTC | |
Re: incrementing a number
by Khen1950fx (Canon) on Oct 12, 2010 at 19:09 UTC | |
Re: incrementing a number
by roboticus (Chancellor) on Oct 12, 2010 at 18:33 UTC | |
by planetscape (Chancellor) on Oct 12, 2010 at 20:57 UTC | |
by roboticus (Chancellor) on Oct 12, 2010 at 21:08 UTC |
Back to
Seekers of Perl Wisdom