text.before ( _text ; _searchString ; _occurrence ; _include.b )
extracts text before search string
Average rating: 4.5 (34 votes) Log in to vote
Fabrice Nordmann - Show more from this author
Before ("aa:bb:cc" ; ":" ; -1 )
Before ("a¶b¶" ; ¶ ; -1)
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
extracts the beginning of a text, based on a search string and an occurrence number
occurrence can be positive (starting from the beginning of the text) or negative (starting from the end)
see also text.after, text.between, and text.betweenNext functions
Ed Schussler, East Hanover, NJ
Sep 26, 2010
The function and narative describe four variables, yet the sample input and ouput section shows only three variables used.
Three variable, four variables, whichever, I can not get any result with this custom function other that that designated as the "searchString". Why?
Sep 29, 2010
use 0 in 4th param, should work as expected.
believe 4th param gives option to include/exclude the 2nd param in result.
Before ("firstname.lastname@example.org" ; "@" ; 1; 0 )
Before ("email@example.com"; "@" ; 1; 1)
Dec 10, 2012
Thanks. This is helpful. How can script be modified to select text, starting from left, of a string up to the first “(”, when there are multiple “(” 's in the text? eg
Actinomycin (Dactinomycin, Antibiotic)(Control Peptide)
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.