Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Juggernaut

Stripping out ALL but Letters, Numbers and Spaces

Featured Replies

  • Newbies

I import a text file that has a product name field with content like this:

 

16.9oz. Oil/Water Set/2

Blue-Widget/Red-Widget™

7CY-QUARTER-A/F-Ajax©

Michael@Home/Black Artwork

 

**these are non-sensical on purpose

 

I'm trying to make all of these lower case, stripping out all of the funky characters and replacing them with single hyphens

 

16-9oz-oil-water-set-2

blue-widget-red-widget
7cy-quarter-a-f-ajax
michael-home-black-artwork
 
I've studied this page all afternoon, and deep into the night. 

 

http://help.filemaker.com/app/answers/detail/a_id/4888/~/tip%3A-removing-non-numeric-characters

 

My eyeballs are crossed. Does anybody know how to do this?

Lower(Substitute(YourTable::YourField; ["."; "-"]; ["/";  "-"]; ["@"; "-"]; ["™";  "-"]; ["©"; "-"]))

 

The fact that you wish to replace the odd characters with hyphens precludes the use of the Filter() function.  Filter() merely eliminates ANY character that is not in the filter list.

I'm trying to make all of these lower case, stripping out all of the funky characters and replacing them with single hyphens

 

You would need a custom recursive function for the last part. And you would need the Advanced version of the application in order to install it.

Alternatively, you could script the process, and apply the recursion through a looping script.

 

Please update your profile to reflect your version and OS.

As comment requested, please change your profile to reflect your current information.

 

Here is a quick link for for you convience. MY PROFILE

Would you be able to replace the special characters with spaces, then use TrimAll, then substitute "-" for spaces?

 

You would need a custom recursive function for the last part. And you would need the Advanced version of the application in order to install it.

Alternatively, you could script the process, and apply the recursion through a looping script.

 

Please update your profile to reflect your version and OS.

Would you be able to replace the special characters with spaces, then use TrimAll, then substitute "-" for spaces?

 

Yes, of course. But the first part - "replace the special characters with spaces" - is non-trivial, because there is no known list of the "special characters". The only known list is the one of allowed characters. Therefore you must either:

 

• Substitute out all allowed characters to obtain a list of "special characters", which you can then use to substitute each one of these with a space;

 

or:

 

• Process the given text character-by-character, comparing each character to the given list of allowed characters, and write out either the character or a space to the output.

 

I believe that with relatively short texts such as the ones shown, the second approach would be preferable - but both require recursion/iteration.

Gotcha. I thought I remembered seeing a calc somewhere that did something similar. So I went looking, and it was a custom function that I had seen.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.