Brian Dunning's FileMaker Custom Functions

SubstituteValuesInText__cf ( _text ; _searchValues ; _replaceValues )

Substitutes multiple searchValues within text with the corresponding replaceValues.

  Average rating: 4.2 (43 votes) Log in to vote

Steve Hearn   Steve Hearn
CoreSolutions Development
http://www.coresolutions.ca

Share on Facebook Share on Twitter

  Sample input:
SubstituteValuesInText__cf ( "ABCDE ABCDE¶ABCDE" ; "B¶D" ; "2¶4" )
  Sample output:
A2C4E A2C4E¶A2C4E

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Description
Substitutes multiple searchValues within _text with the corresponding replaceValues. The _searchValues and _replaceValues are intended to be a matched pair, typically the result of a List function. Originally developed to search for and replace strings defined in a table.

Example
_text: This is a sample letter with merge fields like <> and <> that are user-friendly field names. A table has a list of these user-friendly fields as well as their corresponding "real" field name.

_searchValues: <>¶<>

_replaceValues: <>¶<>

output: This is a sample letter with merge fields like <> and <> that are user-friendly field names. A table has a list of these user-friendly fields as well as their corresponding "real" field name.

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: