Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

I need to parse out a 5 digit number out of a text string. It can appear anywhere within the text so it can't be a left or right word calc. Is there a way to parse a 5 digit number out? It would seem simple. Also it would be nice to be able to get the 3 letter code following the number.

Some example strings.

zJobs1 Archive:34939-oul11-2:IT - PDF Folder:

zRip2Disk Archive:35727-HOR-2(RSIdata):Default Job:Primex12.eps:Stats:

Anchor:55587-afp-02

Try this:


Middle(TheString, Position(

Substitute(Substitute(Substitute(Substitute(Substitute(

Substitute(Substitute(Substitute(Substitute(Substitute(TheString,

"0", "~"),

"1", "~"),

"2", "~"),

"3", "~"),

"4", "~"),

"5", "~"),

"6", "~"),

"7", "~"),

"8", "~"),

"9", "~"),

"~~~~~", 1, 1), 5)


  • Author

Works perfectly. By increasing the last digit I can also get it to grab the 3 letter code and then strip that out by using middle words. If I wanted to just grab the 3 digit code seperately could that be done. I tried reading through the calc to duplicate it to do that and got lost.

Thank you Very Much.

Wayne

What this formula does is replace all the numerals with the squiggle "~" character and then search for starting position of five squiggles in a row which is the starting position of the five digit number. To get the 3 character suffix, just add 6 to the position, and change the length to 3 as follows:


Middle(TheString, 6+Position(

Substitute(Substitute(Substitute(Substitute(Substitute(

Substitute(Substitute(Substitute(Substitute(Substitute(TheString,

"0", "~"),

"1", "~"),

"2", "~"),

"3", "~"),

"4", "~"),

"5", "~"),

"6", "~"),

"7", "~"),

"8", "~"),

"9", "~"),

"~~~~~", 1, 1), 3)


Personally, I would just use this to get the whole 9 characters and then process that separately. Considering speed issues, since this is a rather complicated formula, why use it more than once when you can grab the important chunk of 9 characters, and then parse it with much simpler formulas.

  • Author

That sounds like a good way to go. I wasn't sure if getting all the characters at once then parsing would be faster or not. It makes sense only to run the large parse for 1 calculation.

Thanks,

Wayne

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.