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.

Find and delete a word in a paragraph

Featured Replies

Hi,

Using a script I will like to find and remove only the word "Home" in a paragraph. is this possible?

Thanks in advance

 

Yes, it's possible.  Tell us more. Is your search case-sensitive? What about words that contain the string "home" e.g. "homeless" or "psychometric"?

  • Author

Great!!!

Yes case-sensitive, and the search must be exact because there are other words that contain "home". Let's say I need to remove HOME000009 from the list but leave the rest.

          home000005

          home000008

          HOME000009

          Appartment000004

          Room0000012

You can filter that out.

Filter (yourField); "0123456789")

I am afraid this is still not clear enough. You did not mention a list until now. A return-separated list of values is not the same thing as paragraph of words (even if your list contains only single-word values).

Anyway, it sounds like you want to go over a list of values, and remove a value if it contains the string HOME (case-sensitive) - is that correct?

 

  • Author

Sorry for not explaining correctly, honestly I thought that for FileMaker a return-separated list was the same thing as a paragraph.

You're right, I need to find a value in a return separated list and delete it from the list.

Hi Gilbert,

20 minutes ago, Gilbert13 said:

I need to find a value in a return separated list and delete it from the list.

Delete what, this home000008, or the word "home" (leaving the 000008)?

Lee

26 minutes ago, Gilbert13 said:

I need to find a value in a return separated list and delete it from the list.

See if something like this could work for you: 

RemoveValues.fmp12

  • Author

Yes, exactly what I need, thank you very much to both for the help.

Please can you recommend some book that teaches how to build scripts?

Thanks

I don't think we can recommend a specific book, there are some variables we don't know, such as your skills. I would recommend that you check out the book stores near you, or go online to 

ecampus.com

Barnes and Noble

Amazon.com

You can download the Sessions Material from DevCons 2017, this session https://community.filemaker.com/docs/8302  has a video here https://www.youtube.com/watch?v=8Ts9P95CbRY&feature=youtu.be that you may find helpful. 

I can recommend some Training Sites that offer sessions on scripting and a lot more.

HTH

Lee

 

Edited by Lee Smith
fixed the links

  • 5 months later...
  • Author

Hi Comment, 

It is possible to modify the script so that will only removes the exact string in gSearchString ?

I have the following numbers in source. Instead of just removing 2 the script also remove 22 when the value in gSearchString is 2

2

3

9

22

55

Thanks in advance

  • 2 weeks later...
  • Author

Hi Lee,

How can I use the == signs so the script substitutes the exact value in gSearchString?

Thanks

5a7c722d8bc61_ScreenShot2018-02-08at11_51_13AM.png.74a7e2e646d54548374ea850a54fbdf3.png

Hi Gilbert,

  1. The script furnished by comment was written to isolate the records that started with a specific pattern in front of the numbers.
  2. You don't need a script for a simple find such as the number 2 in a number fields, as long as it is the only number.
  3. By chance are these the remaining numbers that are in your original field? 
  4. Your find request in a number field for 2, should not be returning 22.

Perhaps if you should attached a copy of the file, so we can be sure we provide a script you can plug in to your file.

This post by Ocean West provides info on how to protect your confidential data. Anatomy of a Good Topic

I added a demo of a simple scripted find.

HTH 

Lee

FindNumbers.fmp12

Create an account or sign in to comment

Important Information

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

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.