I’m working in python 2.6 and I would like to take “gpmetisfile.txt.part.4” and return just the number 4. (Ordinarily I would just lop off and save the end value, but its length and arrangement may change in the future and I would rather be safe and just obtain the numbers, in order, from the string itself).
There was a question similar to mine in 2009, but the answers were conflicting.
Thanks in advance.
The following does what your question answer says: removes everything but the numbers. Is that what you need?
The reason why I ask is that, for instance,
'gpmetisfile.txt.06_2012.part.4'will become'0620124'.