Brian Dunning's FileMaker Custom Functions

_WordShrink ( text ; direction ; characters ; break )

Truncates all words in a string to the same length

  Average rating: 4.6 (27 votes) Log in to vote

Josh Morton   Josh Morton
JEM CONSULTING

Share on Facebook Share on Twitter

  Sample input:
_WordShrink ( "University of Colorado Denver" ; "l" ; 4 ; "_" )
  Sample output:
Univ_of_Colo_Denv

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

Based on "FormatList" by Therese Telepski, Art + Promotion

Sets All words in a string to the same length and can put in custom separator.

This is a good way to truncate text for file naming or other abbreviations

The "direction" param allow for truncating from the left "l" or right "r"

 

Comments

Bob   Bob, east hampton
Dec 8, 2011
so what purp woul I have for some like this
 
Josh   Josh, New York
Dec 8, 2011
If you want to create an shorted title based on long string. It could be school name as in this example or book titles or product name to automate file/folder names or for display/printout purposes.
 
Brent Simon   Brent Simon, Central California
Dec 9, 2011
It's great for naming pdf's that have long titles. I have been looking for something like this. Excellent work. Thanks!
 
Josh   Josh, New York
Dec 9, 2011
You can also use it with Filter_Stopwords ( Text )

http://www.briandunning.com/cf/936

To clean up further by removing "Stopwords" the, of, and, etc. also you can easily modify that CF by adding extra words if you want.

So

Filter_Stopwords ( _WordShrink ( "University of Colorado Denver" ; "l" ; 4 ; "_" ) )

would become Univ_Colo_Denv
 
Brent Simon   Brent Simon, Central California
Dec 9, 2011
Even better! Perfect!
 

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.

Under construction. Email me your wish list for improvements.