Brian Dunning's FileMaker Custom Functions

RemoveValue ( listOfValues ; valueToRemove )

Removes all instances of a value from given list, disregarding case

  Be the first to rate this function Log in to vote

Douglas Faneuil   Douglas Faneuil - Show more from this author
n/a
http://n/a

Share on Facebook Share on Twitter

  Sample input:
RemoveValue ( "CAT¶cat¶Dog¶Cat¶Horse¶" ; "cat" )
  Sample output:
"Dog¶Horse"

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

This function removes a specified value from a given list without recursion:

• no matter how many times it appears
• no matter how many repeating (stacked) instances exist*
• no matter the case**

*Technically, this function can handle up to 426 repeating instances before failing (ie, leaving a value intact). This limit only applies to back-to-back values (eg, "Cat¶Cat¶Cat"). Otherwise, there's no limit; I've tested more than 100K removals successfully.

**With regard to case, four arrangements get removed: all caps, all lower, titlecase, and as-input. Funky entries like "PeoPLe" will be skipped unless specified.

Note! This function contains another function — SuperTrim ( text ) — which is used to trim lists of leading/trailing carriage returns (¶). All lists get trimmed in the end.

Finally, I wrote this because a lot of similar functions were failing to remove instances of back-to-back values, especially those topping a list. And I wanted various cases to be addressed as well. No attribution necessary. Enjoy!

 

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: