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.

Search text!

Featured Replies

Any ideas how to solve this problem? I have a field with a page of text. What i would like to get is a script that searches for a specific word (Cast&Crew) and copys the text between the specific word (Cast&Crew) and a second word that follows sometime after in the text. The in between text then will be entered into the field.

Any ideas??

Thanks!

Hi tmas73,

and a second word that follows sometime after in the text.

Well, we have the start of our search (Cast&Crew). But you haven't given us an end. frown.gif If you can tell us how to determine where the end is, we can grab everything inbetween and insert it in a field for you via script. smile.gif

Cheers,

LaRetta

  • Author

The 2 word is (Runtime:) So the idea is to get the text between Cast&Crew and Runtime: and place it into a field..

Thanks La Retta

LeftWords( Middle( textfield, Position( cast, "(Cast&Crew)", 1, 1 ) + 11, Position( textfield, "(Runtime:)", 1, 1 ) - Position( textfield, "(Cast&Crew)", 1, 1 ) - 11 ), 9999 )

  • Author

Thank you very much!! I go it to work.

I have one more question.

I only have (Cast&Crew) and i want following few letters or words after cast&crew??

Thanks for your time!

Hello tmas73,

Middle(TextField, Position(TextField, "Cast&Crew", 1, 1 ) + 11, 3)

will give you the first three letters following 'Cast&Crew', and

LeftWords(Middle(TextField, Position(TextField, "Cast&Crew", 1, 1 ) + 11, 9999), 3)

will give you the first three *words* following 'Cast&Crew'. cool.gif

  • Author

Thanks Ray worked out fine. i just wonder if it is possible to include a logical function like for example:

Go to Cast&Crews on the page and looks for a word after "CastandCrew". Like the Cast&Crew is a starting point for a second search.

Search for "Cast&Crew" -> search from point "Cast&Crew" and look for "USA:R"

I'm sorry for my "beginners brain" but I really have problems with those search word logic.

Thank you!!

The following expression:

Case(Position(TextField, "USA:R", Position(TextField, "Cast&Crew", 1, 1 ), 1 ), "Yes", "No")

...will return 'yes' if the text 'USA:R' occurs in TextField after the first occurrence of 'Cast&Crew'. And in fact:

Position(TextField, "USA:R", Position(TextField, "Cast&Crew", 1, 1 )

will give you the character number where USA:R starts. wink.gif

  • Author

Thanks again ray but this time I had no luck!! this is the script i use!!

Left(Middle(myText, Position(myText, "USA:", Position(myText, "Certification:", 1, 1), 1) 4, 9999), 5)

It works fine with "USA:R" but if there is "USA:PG-13" it will cut off 4 letters to the right. I also cant display 4 to the right because after "PG13 or R" there follows a "/" and some other text. So it would display "R /.." Is there a solution where I have as start point "USA:" and to the right the "/".

My field of interest is only the rating for the USA so I'm trying to filter it out from a page of text.

Like (Must find Certification subcategory USA: !!!!

"Certification: Australia:M /Finland:K-16 /France:-12 /Norway:16 /Sweden:15 /UK:15 /USA:R /West Germany:16"

I hope this all makes sense!!

Thomas

Try this:

Middle(MyText, Position(MyText, "USA:", Position(MyText, "Certification:", 1, 1), 1),

Position(MyText, "/",Position(MyText, "USA:", Position(MyText, "Certification:", 1, 1), 1), 1) - Position(MyText, "USA:", Position(MyText, "Certification:", 1, 1), 1))

Try this one....

Middle(text,Position(text, "USA:R", Position(text, "Certification:", 1, 1 ),1),Position(text, "/", Position(text, "USA:R", Position(text, "Certification:", 1, 1 ),1), 1) - Position(text, "USA:R", Position(text, "Certification:", 1, 1 ),1))

or a little smaller

Middle(text,Position(text, "USA:R", Position(text, "Certification:", 1, 1 ),1),

Position(Right(text, Length(text) - Position(text, "USA:R", Position(text, "Certification:", 1, 1 ),1)), "/", 1, 1))

Ray, you beat me to this

It always takes me a "little" more time than you to put this down wink.gif

At least, I'm now sure it'd work grin.gif

Hi Ugo,

Your second calc my be a little shorter, but you will find that it will fail if there is a '/' between 'Certification' and 'USA:'.

Once you correct for this you'll then find that it is then longer than the previous version. wink.gif

  • Author

Woooww guys, I am amazed!! I have no idea how you can get to this result!!

IT WORKS all 3 versions. The only small change would be:

The result I get is "USA:PG-13" what do i have to do to get rid of "USA:".

Deeply grateful! =)

Thomas

The simplest way is probably:

Middle(MyText, Position(MyText, "USA:", Position(MyText, "Certification:", 1, 1), 1) + 4,

Position(MyText, "/",Position(MyText, "USA:", Position(MyText, "Certification:", 1, 1), 1), 1) - Position(MyText, "USA:", Position(MyText, "Certification:", 1, 1), 1) - 4)

Well,

Assuming :

- your goal is to parse a given string within a looping script.

- It's not given for sure that this string exists in that record

- That in this later case, you want the result to be "Empty"

- You want to remove the hyphen also.

You may try the following Long calculation, involving 2 global fields for FirstString and SecondString.

Choose(not Position(TextField&"/",SecondString, Position(TextField&"/", FirstString, 1, 1 ), 1 ),

Trim(Substitute(Middle(TextField&"/",Position(TextField&"/", SecondString, Position(TextField&"/", FirstString, 1,1 ),1),Position(TextField&"/", "/", Position(TextField&"/" ,SecondString,Position(TextField&"/", FirstString, 1, 1 ),1), 1) - Position(TextField&"/",SecondString, Position(TextField&"/", FirstString, 1, 1 ),1)),SecondString& ":","")),"Empty")

  • Author

Ray, you did it!! Thaks a lot for all the help. Also thanks Ugo and the forum!

Thomas

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.