Brian Dunning's FileMaker Custom Functions

Text_Get_DelimitedValue ( _text ; _delimiter ; _occurence ; _default )

Extracts the nth value from a delimited text counting from the left or right end.

  Average rating: 4.4 (35 votes) Log in to vote

Rewolfer   Rewolfer - Show more from this author
http://rewolfer.de

Share on Facebook Share on Twitter

  Sample input:
Text_Get_DelimitedValue ("this|table|broke|down"; "|"; -2; "not found")
  Sample output:
broke

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

/*=========================================

FORM: Text_Get_DelimitedValue ( _text; _delimiter ; _occurence ; _default )

PURPOSE: extracts the nth value from a delimited text counting from the left or right end

PARAMETER: _text text not "" text
_delimiter text not "" delimiters like "|" or "
" etc
_occurrence number not 0 nth occurrence that is wanted; negative value counts from right
_default text "" default value to be returned if delimiter was not found or occurence was out of index

RESULT: text (or default-parameter)

DEPENDENCY: -

NOTE: supports only ONE delimiter

EXAMPLE: Text_Get_DelimitedValue ("this|table|broke|down"; "|"; -2; "not found") --» "broke"

DEVELOPER: tsw @ http://rewolfer.de

=========================================*/

 

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: