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

Featured Replies

HOw would I do this?

If any word in "selected text" contain 1 letter then ignore

For example A & B CompanY or Company A & B or A company B

would return simply "Company"

Any help would be great

  • 3 weeks later...

You must loop through the entire text field word by word. Evaluate each word as you loop through and rebuild the "selected text" by evaluating the length of the word. If the length of the word = 1, do not add it to the rebuilt "selected text", else add the word to the rebuilt text.

You probably should use global fields to complete the evaluation. Keep in mind that text parsing is tedious and difficult. But it is one of the keys to becoming a professional.

You could create a calculation to do this, but it would have a word limit hard-coded into it.

It'd be something like

If ( Length (MiddleWords(textfield, 1, 1) = 1, "", MiddleWords(textfield, 1, 1) & " " ) &

If ( Length (MiddleWords(textfield, 1, 2) = 1, "", MiddleWords(textfield, 1, 2) & " " ) &

If ( Length (MiddleWords(textfield, 1, 3) = 1, "", MiddleWords(textfield, 1, 3) & " " ) &

If ( Length (MiddleWords(textfield, 1, 4) = 1, "", MiddleWords(textfield, 1, 4) & " " ) &

etc.

I may have got the syntax for the MiddleWords function wrong, check which parameter refers to the starting word and increment that for each iteration.

You could also use a repeating calculation a la

Case ( not Length (MiddleWords(Extend(textfield), index, 1)) = 1, MiddleWords(Extend(textfield), index, 1) )

then use a ValueListItems calculation to concatenate the results.

I mostly copied and pasted. Thanks for the corrections, Ugo. laugh.gif

I don't know about the odd characters. What happens if you set the index to ASCII?

Hi JT,

Yes, but wouldn't Extend( ) be used here too...Didn't tried the " " trick, but I don't get it.

And what should we don with " ' ", or "-" or other characters that sometimes should be considered as characters...

Hi Vaughan,

I tried your calculation, and did get some errors in the syntax. Here is a modification of your calculation that seems to work as expected.

If( Length(MiddleWords(textfield, 1, 1)) = 1, "", MiddleWords(textfield, 1, 1) & " " ) &

If( Length(MiddleWords(textfield, 2, 1)) = 1, "", MiddleWords(textfield, 2, 1) & " " ) &

If( Length(MiddleWords(textfield, 3, 1)) = 1, "", MiddleWords(textfield, 3, 1) & " " ) &

If( Length(MiddleWords(textfield, 4, 1)) = 1, "", MiddleWords(textfield, 4, 1) & " " )

as you can see, the starting point in the middlewords was reverse and it required a second ")" prior to the =1,

HTH

Lee yay.gif

Hi -Queue-,

Did I miss a memo? wink.gif

I'm really lost, and it sounds like I missed a post or something. If so could you point me to where this was discussed already, if not how about a little more explanation on this post.

What is the "index" Field?

What is the ValueListItems calculation

Is there a file explaining this that you used to copy and paste from?

Sorry for being a pest here, but I'm always looking at better ways to do these things, and I'm sure it will help others too.

Lee confused.gif

No problem, Lee. This is a method I post frequently, which is why I didn't feel the need to elaborate on it at the moment.

Index is a repeating field containing 1, 2, 3, etc.

A repeating calculation is used that only needs one line and is dynamic.

A value list is created based on the repeating calc.

The VLI calc is just the VLI calc with some substitutes added for easier viewing.

The only drawback is that a forced refresh is necessary, either a Go to Field pointing to the VLI field, a Go to Next/Previous, or an Enter Find Mode - Enter Browse Mode.

For calcs only a few lines long, it's probably more of a nuisance than typing out the redundant lines with only a couple of values changed. It can be much easier, not to mention more dynamic, however, than hardcoding a 20 plus line calc. Version 7 makes this even nicer by eliminating the need for a global index field for Index to lookup by using Get(CalculationRepetitionNumber), although it has a problem with related repetitions (though I hear this is to be fixed soon).

Attached is an example for the original question in this thread.

Vli.zip

Hi -Queue-,

Thanks for your sample file, and additional comments.

Now that I see it, I do remember you used this approach on something in the past. I guess I need to take your file apart and see what makes it tick.

Thanks again,

Lee confused.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.