Help

Re: Converting HTML

Solved
Jump to Solution
3381 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Alba_Machado2
7 - App Architect
7 - App Architect

Is there a formula I can use to replace, say, " with " ? I find myself often having to go in and do this manually. Thanks in advance for your suggestions! :slightly_smiling_face:

1 Solution

Accepted Solutions

If you want to make multiple changes to some text using several SUBSTITUTE() functions, you’ll need to nest them inside each other. Your second attempt threw an error because you didn’t get the nesting set up correctly. Instead of each SUBSTITUTE() operating on the original content, the outer ones need to operate on the results of the inner ones, like this:

SUBSTITUTE(SUBSTITUTE({Excerpt}, '--', '—'), '"', '"')

Nested functions always work from the inside out. In this case, it first swaps out double-dashes in the original content for an em dash, and then that result is processed to fix the quotes.

See Solution in Thread

6 Replies 6

The items you’re replacing didn’t come through. Here’s what I see:

Are you trying to replace quotes? Both of those look the same. Can you describe what you want to do in greater detail?

Attempt number three:

I want &-q-u-o-t-; replaced by "

Maybe spelling it out like a swear word will work?

Success! :grinning_face_with_big_eyes:

This is fairly easy using the SUBSTITUTE() function:

SUBSTITUTE({HTML Field}, """, '"')

FWIW, what I just did there is a great way to force the forum to honor whatever you type: turn it into preformatted text using the </> item in the editor toolbar. For multiple lines of text, wrap them in pairs of graves triplets (the grave is this: ` — it shares the key with the tilde ~ symbol). With that, this:

```
Testing 123
```

…becomes…

Testing 123

Thanks! That formula worked for the quotation mark, but not for additional adjustments that needed to be made. Here’s how I tweaked it to take on one of those additional adjustments:

Attempt Number 1:

SUBSTITUTE({Excerpt}, '&quot;', '"') & SUBSTITUTE({Excerpt}, '--', '—')

Attempt Number 2

SUBSTITUTE({Excerpt}, '&quot;', '"', SUBSTITUTE({Excerpt}, '--', '—'))

The first attempt didn’t make the dashes/bar adjustment, and the second attempt returned an error message. And I always wondered about the preformatted text thing! :slightly_smiling_face:

If you want to make multiple changes to some text using several SUBSTITUTE() functions, you’ll need to nest them inside each other. Your second attempt threw an error because you didn’t get the nesting set up correctly. Instead of each SUBSTITUTE() operating on the original content, the outer ones need to operate on the results of the inner ones, like this:

SUBSTITUTE(SUBSTITUTE({Excerpt}, '--', '—'), '&quot;', '"')

Nested functions always work from the inside out. In this case, it first swaps out double-dashes in the original content for an em dash, and then that result is processed to fix the quotes.

Perfect! Thanks, Justin! :grinning: