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

CountWordOccurrences ( text ; searchWord )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 4.8  (33 votes)
  Discuss this Custom Function

Michael Horak, *COMMENT Visual Realisation
http://comment.cjb.net/

Returns the number of occurrences of searchWord as word in text.

Sample Input:
CountWordOccurrences ( "Ground control to Major Tom, ground control to Major Tom: can you hear me, Major Tom?" ; "tom" )


CountWordOccurrences ( "Tom stomped on an atom." ; "tom" )


CountWordOccurrences ( "Tom's tomcat stomped on an atom." ; "tom" )
Sample Output:
3




1



0


 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:

Returns the number of occurrences searchWord appears as a word in text. The function is NOT case-sensitive.

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 6 comments

It may be simpler, but it's not doing the same thing at all: check your results against mine in the examples above.

comment, VR
February 08, 2012 12:41am

I see what you mean, sorry about this.

Henk Brendel, Arnhem, NL
February 08, 2012 1:28am

This is exaclty what I need, but FileMaker 11 gives me an error. "This function cannot be found."
I believe it is refering to "Let ( countWords = WordCount ( text )".

Can you help me understand, please.

dwetzel@skywest.com

Thanks in advance.

Danton Wetzel, Saint George, UT
September 10, 2013 9:03am

Like this function much but problems with it.

Dear dwetzel@skywest.com,

You ever get this custom function to work properly?

CountWordOccurrences()

When i use it in a text field that is lengthy i get a spinning ball and have to wait long time!!
Robert

jLT StructuresFromSilence, Kendv,IN USA
April 08, 2015 3:45pm

@jLT

This function goes over your text word-by-word. That takes some time. It was not meant to be applied to large texts, and in any case the maximum amount of words it can process is limited to 10,000 (Filemaker's limit of iterations for custom functions that are not tail-recursive).

You may consider implementing the same algorithm in a looping script, and run the script on demand only, storing the result in a field.

comment, VR
April 08, 2015 6:33pm

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 5 + 9 =
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. decFromHex ( hexValue )
  (Mon, Oct 16, 12:34pm)
2. MonthYearList ( startmonth ; startyear ; numbermonth ; short )
  (Mon, Oct 16, 3:38am)
3. ErrorDescription ( errorNumber )
  (Wed, Sep 27, 2:51am)
4. decodeEntities (text)
  (Wed, Sep 27, 1:22am)
5. HexidecimalToNumber ( HexidecimalValue ; counter )
  (Mon, Sep 25, 12:39pm)
6. 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)
7. ShannonEntropy ( text )
  (Thu, Sep 07, 5:59am)
8. LetterCount ( text ; summary )
  (Thu, Sep 07, 5:53am)

RSS Feed of Custom Functions