Brian Dunning's FileMaker Custom Functions

CleanText ( Text )

Strips out illegal text characters and simplifies.

  Average rating: 4.1 (37 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:
This is a test of some weird text with strange characters like tilda ~ and back quote `
and some back slashes \\\ etc. Here’s a bulleted list:
• Test
• Test 2
It will change the bullets to asterisks
here is an inch mark ‘
and some normal quotes “
And some curly quotes “ ” ‘ ’
  Sample output:
This is a test of some weird text with strange characters like tilda and back quote '
and some back slashes etc. Here's a bulleted list
* Test
* Test 2
It will change the bullets to asterisks
here is an inch mark '
and some normal quotes '
And some curly quotes ' ' ' '

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

Gets rid of strange characters leaving only normal ones.

 

Comments

Kim Khan   Kim Khan, New York - Times Square
May 21, 2009
Hey this is great! Just what I was looking for. I am a novice and need lots of assistance to get up to speed. We get data from various countries and sometimes they contain weird characters. I will need to add good replacements for weird characters like the umlaut O should just be replaced with an O. Do you have any suggestions? Thanks!!
 
Brent Hedden   Brent Hedden, San Diego, CA
May 1, 2012
Unless there is a specific reason why not, you should also add the : character to this function. Makes a big difference if you're inserting timestamps/time into a text field.
 
Richard Stuart   Richard Stuart, Ceti Alpha 5/Texas
Sep 5, 2012
Just a thought:

When pasting text from elsewhere another item for clean-up is the bullet-with-tab; unless you have FMP's text field field set up tabs and indents, extra tabs will make the text look goofy so you may want to add the following to the substitute command string:

[ Code(9) ; " "]

Great CF, Tim!
 

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: