I have a directory full of non-empty directories, all with the same prefix, but different numbers at the end. E.g.
ABCDE_0003
ABCDE_0005
ABCDE_0007
ABCDE_0009
ABCDE_0011
I would like to extract the number at the end of these directory names, excluding the 0's, into a list from which I can call the indices (numbers) for other automated purposes:
[3,5,7,9,11]
I have tried searching for solutions to this and have found that others have done this for file names, but not directories such as in this thread:
Extract substring from filename in Python?
Perhaps there are similar methods to those mentioned in the above thread. I contemplated that a plausible solution could be to have a script convert the directory names into strings, and then it may be easier to extract the number prefixes that way, but I have not found how to do that either. Any ideas?