PickAPart__cf ( _text ; _partNumber )
Will return the specified _partNumber within delimited _text
Average rating: 4.2 (35 votes) Log in to vote
Matthew Leering CoreSolutions Software Inc. http://coresolutions.ca |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
To search a string of text with the delimiter defined below, and return only a particular part number from that text
Comments
Tim, JEAMA Oct 2, 2013 |
||
Looks over complicated how about getvalue( substitute( _text;"|";"¶");_partNumber) extending that you could even included a parameter for the delimiter |
||
Matthew Leering, Canada Oct 3, 2013 |
||
Your solution is excellent Tim! It's very easy to understand exactly what it's doing, and is efficient also. The only drawback I can see to it is that it won't support parts that have hard-returns. |
||
William, Seattle Oct 3, 2013 |
||
... and yours will not work if the pipe is part of the part number :-)) | ||
Matthew Leering, Canada Oct 3, 2013 |
||
Touché Of course, this custom function does let you swap out the delimiter for any other character or set of characters you deem fit. |
||
Tim, JEAMA Oct 4, 2013 |
||
Ok, a solution PickAPart__cf ( _text ; _partNumber ; delimiter) let( _useText=case( delimiter="¶"; _text; substitute( _text;"¶"; "x§§x§§x"); substitute( getvalue( substitute( _useText ; delimiter ;"¶");_partNumber); "§§x§§";"¶") ) |
||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.