Feb-15-2018, 04:41 PM
Hey all,
As the title suggests, I'm quite new to python and programming in general,(although I have some basic understanding and have played a bit with programming before), I have a problem I am trying to solve, hopefully someone can help me out.
I have a list, the list if composed of numbers ranging from 1 to 10 in length. The first 6 digits are prefixes and repeat roughly 350 times the number after the prefix is random. The list is not ordered by the prefix, it is random. I am trying to renumber the list so that any numbers with the same prefix are sequenced, without reordering the list.
To visualize it it works something like this.
current list:
AAAAA.1
CCCCC.50
AAAAA.498
CCCCC.12
BBBBB.9
BBBBB.1954
Desired list:
AAAAA.1
CCCCC.1
AAAAA.2
CCCCC.2
BBBBB.1
BBBBB.2
Any help would be greatly appreciated.
Thanks,
S
As the title suggests, I'm quite new to python and programming in general,(although I have some basic understanding and have played a bit with programming before), I have a problem I am trying to solve, hopefully someone can help me out.
I have a list, the list if composed of numbers ranging from 1 to 10 in length. The first 6 digits are prefixes and repeat roughly 350 times the number after the prefix is random. The list is not ordered by the prefix, it is random. I am trying to renumber the list so that any numbers with the same prefix are sequenced, without reordering the list.
To visualize it it works something like this.
current list:
AAAAA.1
CCCCC.50
AAAAA.498
CCCCC.12
BBBBB.9
BBBBB.1954
Desired list:
AAAAA.1
CCCCC.1
AAAAA.2
CCCCC.2
BBBBB.1
BBBBB.2
Any help would be greatly appreciated.
Thanks,
S