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.

Remove the Before and After in a Text String

Featured Replies

Hi!

 

I have a field containing a file name for example:

 

af10-2689_001

 

I am trying to remove the prepending "af" and everything after the underscore just leaving the

xx-xxxx in the middle.

 

This is what I have so far, but it is not working. I am getting an error message that "List usage is not allowed in this calculation."  Not sure what I doing incorrectly.

 

GetValue (Substitute (file name ; ["af" ; ""] ;  ["_" ; ""]  ; ¶ ) ; 1 )

 

Any suggestion would be most appreciated.

 

Thanks!

Solved by charisse

Go to solution
  • Author

Got it!

 

GetValue (Substitute (file name ; ["ck" ; ""] ;  ["_" ; "¶"] ) ; 1 )

Is it "af" or "ck"? And can you be sure there won't be another occurrence of the string in the file name - say "af10-baf9_001"?

  • Author

Yes. The rest of the values are numeric.

Thanks for bringing that to my attention!

The rest of the values are numeric.

 

Ah. Then you should also note that a dash, when placed between two digits, is NOT a word separator but an underscore is. Therefore =

LeftWords ( file name ; 1 )

would return "af10-2689" in your original example, and =

Filter ( LeftWords ( file name ; 1 ) ; "0123456789-" )

would also remove ANY non-numerical characters without having to hard-code them, resulting in "10-2689".

  • Author
  • Solution

Ah. Then you should also note that a dash, when placed between two digits, is NOT a word separator but an underscore is. Therefore =

LeftWords ( file name ; 1 )

would return "af10-2689" in your original example, and =

Filter ( LeftWords ( file name ; 1 ) ; "0123456789-" )

would also remove ANY non-numerical characters without having to hard-code them, resulting in "10-2689".

 

Perfect!

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.