# Increment alphanumeric characters

Subscribe (0)
Report
Posted on by 233
Hello,
I have a custom requirement where I need to increment a combination of characters (0-9, then following 9 it should go from A-Z) for a custom field
Example : 01, 02...09, 0A, 0B..., 0Z, 10,11...19, 1A...etc.
Can anyone give me an insight how this could be implemented please?
• Jason0810M 233 on at
Increment alphanumeric characters
Thanks Andre,
I have managed to implement my custom logic using the two methods numRemoveFormatV2 and numInsertFormatV2 from the NumberSeq class. I have passed the format based if the character is a number or not (using str2NumOK method to differentiate between the two cases) and it works perfectly fine.
• Andre Arnaud de Cal... 281,692 Super User on at
Increment alphanumeric characters
Hi Jason,

The NumberSeq class has a feature to increment letters. You can have a look at this class to get an example.
• Kevin Xia on at
Increment alphanumeric characters
Hi,
First of all, your requirements involve custom development, and secondly, the part about the hundredth is an example i given to help you refine the logic in this area. Think the range of characters going from 0 to 9 then A to Z as a cycle. As another example, 00 means the first number of the first cycle, 01 means the second number of the first cycle, and 11 means the second number of the second cycle. These two examples will help you write custom code for the relevant logic.
Best regards,
Kevin
• Jason0810M 233 on at
Increment alphanumeric characters
Hello Kevin,

I did not understand the part about the hundredth.
Actually the numbers should go from 00 to ZZ, with the range of characters going from 0 to 9 then A to Z.
• Kevin Xia on at
Increment alphanumeric characters
Hi,
From your logic point of view, the code that implements this logic is not complicated:
Take the second character, 0-9, a-z as a cycle, that is, 36 characters as a cycle; Suppose there are a hundred such fields, then the hundredth should be, 100 divided by 36 equals 2 remainder 28, which means that the hundredth is in the 28th position of the third loop, then the first character corresponds to 2, and the second character corresponds to R, that is, the value of the hundredth digit is 2R.
I don't know if I explained it like that, do you understand?
Best regards,
Kevin