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
1-more-thing https://www.1-more-thing.com |
Before ("aa:bb:cc" ; ":" ; -1 )
Before ("a¶b¶" ; ¶ ; -1)
aa:bb
a¶b
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
Comments
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? |
||
Olly, London Sep 29, 2010 |
||
Oops... meant Ed use 0 in 4th param, should work as expected. believe 4th param gives option to include/exclude the 2nd param in result. eg. Before ("jim@aol.com" ; "@" ; 1; 0 ) = jim Before ("jim@aol.com"; "@" ; 1; 1) = jim@ |
||
Warren, Bostom 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 typical field: Actinomycin (Dactinomycin, Antibiotic)(Control Peptide) result required: Actinomycin |
||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.