Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

ParseData ( theText ; theStartTag ; theEndTag ; theOccurance)

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 3.9  (48 votes)
  Discuss this Custom Function

Hal Gumbert, MacFL
http://www.macfl.com

Extracts text based on a start tag, end tag, and occurance.

Sample Input:
ParseData ( $thePaymentEmail ; "¶Amount: " ; "¶" ; 1 )
Sample Output:
$30.00


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed

Description:

This is great for extracting text within other text. It's especially good for extracting text from forms that are emailed. For example:

If a variable $thePaymentEmail contains:
From: foo@bar.com
To: foo@bar.com
Subject: Payment Info
Amount: $30.00
Payment Type: Discover
Item: Rockem Sockem Robot
Item: Godzilla Figurine
Order Date: 20060909

ParseData ( $thePaymentEmail ; "¶Amount: " ; "¶" ; 1 ) will return '$30.00'.

ParseData ( $thePaymentEmail ; "¶Item: " ; "¶" ; 1 ) will return 'Rockem Sockem Robot'.

ParseData ( $thePaymentEmail ; "¶Item: " ; "¶" ; 2 ) will return 'Godzilla Figurine'.

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

Discuss:

5 most recent comments | Show all 10 comments

Isn't 'occurrence' spelled with an 'e' in the 7th character along?

PeterTJ, London/UK
June 01, 2013 7:32am

Many Thanks !!!
That's a great job.

Phil67, Switzerland
March 31, 2014 9:53am

This is a wonderful function however it causes Filemaker GO to crash every time I run it on the ipad.
Thoughts?

Riyan, Vancouver
February 29, 2016 9:55am

Really useful thanks. How would you use it to return the last value (Order Date in your example) ?

How do you define theEndTag for the very end of the text?

Bob, Manchester
December 08, 2016 11:47am

Great time saver, nicely done function.

One caveat and sharing here in case others have same issues:
when importing text files for processing, I got caught out - i was getting nil value returns from this function.
Turns out that the text files (generated in TextEdit) were using Line Feed instead of Carriage Return. Substituting LF for CR did the trick

Just added this prior to calling the function and all was well:
Substitute (theText ; char (10) ; char (13))

Stam, London
September 14, 2017 11:39am

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 6 + 6 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. FixedFieldConverter ( Fieldname ; f1 ; f2 ; f3 ; f4 ; f5 ; f6 ; f7 ; f8 ; f9 ; f10 ; f11 ; f12 ; f13 ; f14 ; f15 ; f16 ; f17 ; f18 ; f1
  (Fri, Sep 15, 12:34pm)
2. ShannonEntropy ( text )
  (Thu, Sep 07, 5:59am)
3. LetterCount ( text ; summary )
  (Thu, Sep 07, 5:53am)
4. ExactPatternCount ( text ; searchString )
  (Thu, Sep 07, 5:45am)
5. CopyMoveFile ( ~OriginalFilePath ; ~EndFilePath ; ~MacServerPath ; ~PCServerPath ; ~MoveOrCopy )
  (Tue, Sep 05, 6:44pm)
6. SHEXEC ( CMD ; STDIN; PARM )
  (Sun, Sep 03, 8:34am)
7. EOF ( RC ; STDIN )
  (Sun, Sep 03, 8:25am)
8. ListSort ( ValueList )
  (Mon, Aug 21, 11:04am)

RSS Feed of Custom Functions