Brian Dunning's FileMaker Custom Functions

ParseText ( Text, BeginText, EndText )

Parses text from an e-mail message generated by a custom form

  Average rating: 4.3 (32 votes) Log in to vote

Tim Cimbura   Tim Cimbura - Show more from this author
LuminFire
http://luminfire.com

Share on Facebook Share on Twitter

  Sample input:
"City: Maple Grove¶State:¶MN¶Address: 123 Anywhere Street¶" ; "City:" ; "¶"
  Sample output:
"Maple Grove"

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

The custom function is very useful to pull items out of any e-mail message that has been sent via a web form. It will look for a return, tab, space, or no delimiter between the BeginText and the start of the field info.

 

Comments

Roger Biel   Roger Biel, Casa Grande, Arizona
May 13, 2011
By Adding a test for both the Begin & End text the result will return NULL if the markers are missing.
-----------------------------------
Case( PatternCount ( Text ; BeginText ) < 1;""; PatternCount ( Text ; EndText ) < 1;"";
Chunk1<>""; Left(Chunk1;
Position(Chunk1; EndText; 1; 1)-1);"" )
 
Sarah   Sarah, Iowa
Jul 14, 2015
This function doesn't seem to work if the "BeginText" represents the first characters in "Text"...
 

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 15 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: