I am trying to extract a sub-string from a string. The strings are currently in an excel column, row by row and are like this:
ABC 54 SOMETHING 11165 POP 1234567890
SOMETHING ABC/W 05/1234500022385
SomethingW1234500006840Abc05 d 13/1/15
What I want is to extract any 5 or 13-digit number from each row string.
I have come up with this algorithm for the job:
1) Enter line 2) Scan string 3) If numeric/integer found, check length from start to end of numeric string 4) If length = 5 or if length = 13, output only numeric string to next column 5) Enter new line... 6) Continue 1 - 5 Till the data set is exhausted
Is there a function in excel that can do this?
P.S: I am open to learn any language/tool that can get the job done.