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.

Extracting text of variable length

Featured Replies

I have a text field in a database with 1200 records containing 3 lines of text:

First Name Last Name

Street

City, State, Zip

I need to extract just the Street name which has variable number of words of different lengths. What text function or script would be best to use?

Thanks

Welcome to Forums!!

Try this:

MiddleValues ( textField ; 2 ; 1 )

If you wish to set another field with this value, you can use Replace Field Contents (if not being served at the time) or script. If Replace Contents, just enter this calc in the 'Replace with Calculated Result' after putting your cursor in the new field. If by script, use:

Go To Record/Request [ First ]

Loop

Set Field [ newField ; MiddleValues ( textField ; 2 ; 1 ) ]

Go To Record/Request [ Exit after Last ; Next ]

End Loop

LaRetta :wink2:

Well ... that was messy of me. It leaves a hard return at the end so you'll need to remove it. Sorry for my error - I didn't expect that MiddleValues() wouldn't clean itself up ... and we don't want to leave junk in your fields!!

Substitute ( MiddleValues ( textField ; 2 ; 1 ) ; ¶ ; "" )

  • Author

Thank you so much. The MiddleValues ( textField ; 2 ; 1 ) function worked beautifully. What a great resource this Forum is.

Ciao for Niao

Ummm, so do you now need to remove those carriage returns? :blush2:

  • Author

I don't need to for this particular task, but would appreciate knowing how. Thanks again.

Well you could simply run my second calc through again on the new field. Or - JUST to remove carriage return at the end, try:

Substitute ( newText ; ¶ ; "" )

And yes, I agree FM Forums is an excellent resource. But as I've just proved, it's recommended that one backs up first before applying ANY process such as this. :wink2:

Just general information ... with vs. 8 there is a more effective method than MiddleValues(). This would have ALSO removed the carriage return at the end. I see your on vs. 7 but I wanted to remind everyone about this new, wonderful function.

GetValue( textField; 2)

LaRetta

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.