Brian Dunning's FileMaker Custom Functions

Occurrences ( text ; casing )

it returns re-occurring strings either upper- or lowercase seperated by a space

  Average rating: 4.0 (3 votes) Log in to vote

John Segers   John Segers - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
Occurrences
("vertegenwoordigers;0")

  Sample output:
e g o r


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

Occurrences (text ; casing) where text is the text to be tested for re-occurring letters. 0 counts re-occuring lowercast and 1 upper.


The function makes use of the ExactPatternCount function that I found here, and which I renamed EPC to return the letters that occur more than once in a given text. And because the orriginal EPC function it's case sensitive.

 

Comments

Omelyan Burtnyk   Omelyan Burtnyk, Go To Logistics
Aug 11, 2018
/*
Thank you
Good job
More readable like:
*/
If(casing=0;
(
If(EPC(text;"a")>1;"a ")&
If(EPC(text ;"b")>1;"b ")&
If(EPC(text;"c")>1;"c ")&
If(EPC(text;"d")>1;"d ")&
If(EPC(text;"e")>1;"e ")&
If(EPC(text;"f")>1;"f ")&
If(EPC(text;"g")>1;"g ")&
If(EPC(text;"h")>1;"h ")&
If(EPC(text;"i")>1;"i ")&
If(EPC(text;"j")>1;"j ")&
If(EPC(text;"k")>1;"k ")&
If(EPC(text;"l")>1;"l ")&
If(EPC(text;"m")>1;"m ")&
If(EPC(text;"n")>1;"n ")&
If(EPC(text;"o")>1;"o ")&
If(EPC(text;"p")>1;"p ")&
If(EPC(text;"q")>1;"q ")&
If(EPC(text;"r")>1;"r ")&
If(EPC(text;"s")>1;"s ")&
If(EPC(text;"t")>1;"t ")&
If(EPC(text;"u")>1;"u ")&
If(EPC(text;"v")>1;"v ")&
If(EPC(text;"w")>1;"w ")&
If(EPC(text;"x")>1;"x ")&
If(EPC(text;"y")>1;"y ")&
If(EPC(text;"z")>1;"z ")
);

If(EPC(text;"A")>1;"A ")&
If(EPC(text;"B")>1;"B ")&
If(EPC(text;"C")>1;"C ")&
If(EPC(text;"D")>1;"D ")&
If(EPC(text;"E")>1;"E ")&
If(EPC(
 
Omelyan Burtnyk   Omelyan Burtnyk, Go To Logistics
Aug 11, 2018
Continue
If(EPC(text;"z")>1;"z ")
);

If(EPC(text;"A")>1;"A ")&
If(EPC(text;"B")>1;"B ")&
If(EPC(text;"C")>1;"C ")&
If(EPC(text;"D")>1;"D ")&
If(EPC(text;"E")>1;"E ")&
If(EPC(text;"F")>1;"F ")&
If(EPC(text;"G")>1;"G ")&
If(EPC(text;"H")>1;"H ")&
If(EPC(text;"I")>1;"I ")&
If(EPC(text;"J")>1;"J ")&
If(EPC(text;"K")>1;"K ")&
If(EPC(text;"L")>1;"L ")&
If(EPC(text;"M")>1;"M ")&
If(EPC(text;"N")>1;"N ")&
If(EPC(text;"O")>1;"O ")&
If(EPC(text;"P")>1;"P ")&
If(EPC(text;"Q")>1;"Q ")&
If(EPC(text;"R")>1;"R ")&
If(EPC(text;"S")>1;"S ")&
If(EPC(text;"T")>1;"T ")&
If(EPC(text;"U")>1;"U ")&
If(EPC(text;"V")>1;"V ")&
If(EPC(text;"W")>1;"W ")&
If(EPC(text;"X")>1;"X ")&
If(EPC(text;"Y")>1;"Y ")&
If(EPC(text;"Z")>1;"Z ")
)
/*
Author: of ExactPatternCount ( text ; searchString ) Richard Dyce
Source: https://www.briandunning.com/cf/2075
*/
 
John Segers   John Segers
Aug 12, 2018
I agree, its much more readable. Thanks for taking time to comment. And thank you for adding the source. I'll addapt the changes and add your name.
 

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: