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.

Tricky Text Extraction Question

Featured Replies

How could I extract the first continuous string from the right in a text field? The string can contain letters, numbers, as well as special characters such as "-", or "_", or ".". Therefore RightWords or MiddleWords fails/returns incomplete results

Here's an example: -rwxrwxrwx    7 998      1001     244678656 Jan 26 19:11 HBS5_Prototype-DragDropV2.fmp12

What I'm looking to extract is "HBS5_Prototype-DragDropV2.fmp12"

The content to the left is variable, as is the string to be extracted. What is constant is the " " space (and the fact that within the string there are NO spaces). Here are some more examples:

-rwxrwxrwx    1 998      1001      4308992 Feb  5 21:00 HBS5_QualityControl_IC.fmp12

-rwxrwxrwx    7 998      1001     63971328 Jan 30 21:00 DriveTo_Help_Coordination.fmp12

-rwxrwxrwx    2 998      1001     14118912 Feb  1 20:28 int_BlogManager.fmp12

I would need something that goes from the right to the first space, but I'm not sure how to construct that?

Any help greatly appreciated.

20 minutes ago, innodat said:

What is constant is the " " space (and the fact that within the string there are NO spaces)

That's good. So what you want to do is find the position of the last space in the given text, and then either remove everything up to that mark:

Let ( 
lastSpace = Position ( text ; " " ; Length ( text ) ; -1 )
;
Replace ( text ; 1 ; lastSpace, "" )
)

or extract the part after it:

Let ( [
len = Length ( text ) ;
lastSpace = Position ( text ; " " ; len ; -1 )
] ;
Right ( text ; len - lastSpace  )
)

 

Edited by comment

  • 2 weeks later...
  • Author

Wow, so simple if you know how... Many thanks! Works like a charm!

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.