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.

Pull text from the middle

Featured Replies

Text calculations and I don't get along. I have a string which always looks like this:

StaffID ProdID TypeID xxxx xxxxx YYYYMM

The x's represent what I need to isolate and can be one to several words. The IDs vary in length and type but are always separated by a space and always only one word. I've tried:

MiddleWords ( BottleKey; 4 ; LeftWords( BottleKey; WordCount(BottleKey) - 1 ))

... but that gives me xxxx xxxx YYYYMM

I've tried:

Right(BottleKey; Length(BottleKey) - Position(BottleKey; " "; 1; 3) )

... which gives the exact same result. Bummer. I can't drop the YYYYMM off the end no matter what I try!!

Can someone help me with the text calculation and (more importantly) HOW you approached this (from left, right or middle) so I can learn for the next text calculation I encounter. Thank you!!!

LaRetta smile.gif

How about

MiddleWords( BottleKey; 4; WordCount(BottleKey) - 4 ) ?

Your first calc almost has it, but you only need to determine how many X words there are by subtracting 4 (for the StaffId, ProdId, TypeId, and YYYYMM).

  • Author

Oh yeah!!! Perfect, of course!

JT, it always seems so simple when you do it!! I just spent 4 hours on this stinking puppy!!!! I had reached a point of deciding to run two scripts ... one to end up with above result and again to split off the right YYYYMM. blush.gif

I wonder if anyone else ever has done something so silly to get the right text strip (as to run through the records twice)?? But I'm trying very hard not to write trash. Thank you for helping me keep my solution clean!!

LaRetta

My pleasure. smile.gif

I've done a lot of silly things. Then I found Scriptology and FMForums. wink.gif

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.