Skip 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.

Remove a character from the text of a field?

Featured Replies

I need to convert a field with numbers entered with multiple dashes to a number with no dashes. There are thousands of records. Is there a way to script this process? An example is 0-375-41616-1 to 0375416161. Some numbers have dashes in different places. Please help!

Mindy

use the substitute function, but test it out first so you know how it works. Basically you tell it Substitute(fieldname, searchchar, replacechar) so you would tell it to Substitute(fieldname, "-", ""). This is not the exact syntax, use the Cal function. You may have to run this more than once.

HTH

Old Advance Man

There is a quicker and better way to deal with this, because you don’t need a script:

Let’s say the field you want to convert is called NUM1

Create a second field called NUM2

Calculation: Text (make sure NUM1 is also set to text)

Substitute ( NUM1 , “-“ , “ “ )

Ok, now you have a field (NUM2), where (for example) 123-456-789 (in NUM1) is shown as:

123 456 789

Now simply set NUM2 from a calculation to a text field – FMP will give you a warning about losing data, but once you’ve converted, you’ll see that NUM2 has kept the values.

OK! Now simply convert NUM1 to a calculation field

= NUM2

Now you see that both fields are without the “-“

Now simply set NUM1 back to Text instead of a calculation (ignore the warning), and hey presto….. All the “-“ are gone. The beauty of this system is, that although it’s slow, it’s faster than a script, and should anything go wrong during the process, a recovery is much easier. It depends on how many records you have, which method is best. I prefere this, because with each step, you see the results before you have actually changed any stored data!

No disrespect meant “Old A Man” but one-time field conversions are (in my opinion) easier this way, than creating a script…… and faster

No hint of disrespect found in your post. BTW, I don't believe I suggested doing this in a script.

Old Advance Man

One slight adjustment, Rigsby:

Substitute (NUM1,

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.