Jump to content

Perform Text Search/Replace Question


This topic is 7727 days old. Please don't post here. Open a new topic instead.

Recommended Posts

quote:

Originally posted by tripmonk:

Is it possible to do a text search & replace

within a given FMP field? Any help would be appreciated!

You would need to do the scripting of the functionality your self.

You could have a script that performs a search, then does a calculated replace on those records that replaces the specified words.

At least 2 user input fields (search word, replace word) would be needed and you would need to write this script for each field you wanted to do this on, as variable field names are not allowed in FMP.

------------------

=-=-=-=-=-=-=-=-=-=-=-=-=

Kurt Knippel

Senior Filemaker Developer

http://www.database-resources.com

mailto:[email protected]

=-=-=-=-=-=-=-=-=-=-=-=-=

Link to comment
Share on other sites

  • 2 weeks later...

I have never done this, but it might no be too hard if you had a global field to hold the search string, used a generic script that ran on whatever the currently selected field was, using the Paste Result script step in combination with the Subs() function to do the replacement (but it would effectively be a "replace all" operation with no undo -- another global field and script step could provide the ability to undo though.

Thinking about it a bit more, there may be a need for individual scripts tailored to each text field.

Link to comment
Share on other sites

quote:

Originally posted by Vaughan:

I have never done this, but it might no be too hard if you had a global field to hold the search string, used a generic script that ran on whatever the currently selected field was, using the Paste Result script step in combination with the Subs() function to do the replacement (but it would effectively be a "replace all" operation with no undo -- another global field and script step could provide the ability to undo though.

Thinking about it a bit more, there may be a need for individual scripts tailored to each text field.

"OOPS, I didn't mean to overwrite the customer numbers, I just wanted to replace the zip codes." or some such variation will be the enivitable result of doing this kind of operation on the current field. Very dangerous.

Scripting it is both easier and safer, plus it puts the control of program functionality in the hands of the programmer and not the user.

------------------

=-=-=-=-=-=-=-=-=-=-=-=-=

Kurt Knippel

Senior Filemaker Developer

http://www.database-resources.com

mailto:[email protected]

=-=-=-=-=-=-=-=-=-=-=-=-=

Link to comment
Share on other sites

This topic is 7727 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Who Viewed the Topic

    1 member has viewed this topic:
    Lee Smith 
×
×
  • Create New...

Important Information

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