Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting numbers in a string

Status
Not open for further replies.

AndyCamp

MIS
Sep 26, 2017
2
CA
I am trying to extract numbers within parenthesis in a string; the problem I'm having is that some strings may have more than one set of parenthesis; the numbers I want to extract will always be at the end of a string, just before the extension.

For example,

2017-08-20 MANAGEMENT REPORT (AUGUST) - MARK SOBEY (1111).PDF

I want to be able to extract the numbers 1111. I tried the following formula, but it's not working properly:

ExtractString({@Extension}, "(", ").PDF")

@Extension is a formula that combines the filename and the extension.

Any help would be appreciated.
AC
 
try

Tonumber(Split(StrReverse(Split(strReverse({@Extension}),'(')[1]),')')[1])

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top