August 13, 200025 yr Newbies Is it possible to do a text search & replace within a given FMP field? Any help would be appreciated!
August 13, 200025 yr 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] =-=-=-=-=-=-=-=-=-=-=-=-=
August 23, 200025 yr 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.
August 24, 200025 yr 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] =-=-=-=-=-=-=-=-=-=-=-=-=
Create an account or sign in to comment