Find and Replace "spaces" Script

Topic Labels: Scripting extentions
1811 2
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

Hi I have a price field that I auto import prices from and it comes out as “7 99” because that’s how this specific website shows the price. I want to use the find and replace script to replace the spaces " " with a period “.” however that doesn’t work. Idk code but should this fix be done in my data scraping or can airtable fix it.

2 Replies 2

This can be done with a formula:

SUBSTITUTE({Price Field}, " ", ".")

If you want to turn that into an actual decimal number, wrap that in the VALUE() function:

VALUE(SUBSTITUTE({Price Field}, " ", "."))

Be sure to set the field formatting to display decimal values.

6 - Interface Innovator
6 - Interface Innovator

Because you mentioned scraping

Here is another Formula that might come in handy:

REGEX_REPLACE(TRIM({example of scraped text}), '\\s','.')

So this does two important things:

  1. It trims or removes the whitespace that might be dragged along from the scraping process (very common in my experience)
  2. uses the \s regex:
    \s matches any whitespace character (equivalent to [\r \n \t \f \v])