Skip 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.

Text Parsing Help - suffix?

Featured Replies

I'm currently using the following code below to text parse a field in my database.

It has worked GREAT however I've come to the end of the text and I'm not sure how to say: Pull all text after the Prefix and don't stop at the suffix because there is no suffix.

Any Ideas?

 

Let ( [
Textfield = BWIA2 FMP11 2::Web Quote Entry ;
prefix = "Comments / other pilots / Explain Losses:" ;
suffix = "Bill White Insurance" ;
start = Position ( Textfield ; prefix ; 1 ; 1 ) + Length ( prefix ) ;
end = Position ( Textfield ; suffix ; start ; 1 )
] ;
Middle ( Textfield ; start ; end - start )
)

Play around with this calculation:

Let ( [
Textfield1 = "Comments / other pilots / Explain Losses: this is the text I am after so be cool Bill White Insurance" ;
Textfield2 = "Comments / other pilots / Explain Losses: this is the text I am after so be cool" ;
Textfield3 = "this is the text I am after so be cool Bill White Insurance" ;
prefix = "Comments / other pilots / Explain Losses:" ;
suffix = "Bill White Insurance" 

] ;

Trim(Substitute(
Textfield1
;[prefix, ""]
;[suffix, ""])) & "¶¶" & 

Trim(Substitute(
Textfield2
;[prefix, ""]
;[suffix, ""])) & "¶¶" &

Trim(Substitute(
Textfield3
;[prefix, ""]
;[suffix, ""])) 

)

Obviously, replace your field with my test string. 

Hope this helps!

I'm not sure how to say: Pull all text after the Prefix and don't stop at the suffix because there is no suffix.

Your question can be read in two ways:

(a) extract all text after the prefix; OR

(b) if there is a suffix, extract the text between the prefix and the suffix; otherwise extract all text after the prefix.

 

  • Author

Thanks dwdata, how do I put this to obtain the data from textfield web quote entry?

Thanks Comment, the answer would be A. Extract all text after the prefix.

 

 

the answer would be A. Extract all text after the prefix.

That's good, because that's the easy one:

Let ( [
prefix = "your prefix here" ;
start = Position ( Textfield ; prefix ; 1 ; 1 ) + Length ( prefix )
] ;
Right ( Textfield ; Length ( Textfield ) - start + 1 )
)

 

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.