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.

Is there a way to optimize this Find-Replace script?

Featured Replies

Hi,

I'm writing a find-replace script to change special characters to Unicode code and another script to change them back to special characters (see screenshot). It seems I should be able to assign the "Go to Field" once and run ~1000 Find/Replace(ments) in one go.  I'm not going to switch to another Field during this process.  Is the Script Workspace the right way to do this or would it make sense to have the Find/Replace units in another .fmp12 file?

Best,

Daniel

Screen Shot 2017-06-03 at 22.21.57.png

Is there a reason why you cannot use the Substitute() function within a single Set Field (or Replace Field Contents, if you're handling multiple records) script step? A single instance of Substitute() can contain up to 999 search/replace pairs, and you can nest multiple instances if you need more.

BTW, if you have a "map" of search/replace pairs that you need to use in both directions, you might consider storing it in a table or hard-coding it to variable/s. Then use a looping script to perform the substitutions. This would be useful if the "map" ever needs to be changed, as it would only require one change for both directions.

 

 

Edited by comment

  • 1 month later...
  • Author

Thank you for the suggestion.

I migrated the Script replacements to a calculation field using Substitute and it's working fine. It's also blazingly fast.

Best,

Daniel

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.