Problem using REPLACE to swap quotation marks

When I try to do a "convert tag to filename" with the following scripting function, I get a syntax error: $replace(%artist%\%album%\%track% ^ %title%,: , -- ,/, - , , ,",').

I believe the error has something to do with trying to replace double quotation marks with single marks, which is the last "replace" on the end. What's the proper way to reference quotation marks in this script?

Single quotes have a special function so you must write two of them ''

Ah. So the command is $replace(%artist%\\%album%\\%track% ^ %title%,: , -- ,/, - , , ,",''). Thanks.

... and this is what doesn't work in my case.

I try to replace the " in title by '' (it appears often as 7" and I wanna avoid quotation marks for reasons)

So I wrote

$replace(%TITLE%,",'') (hard to be seen but 1st is quotation mark, 2nd is 2 single quotes).

If I perform it as action, it changes e.g. 7" Mix -> 7' Mix (writing only one quote).
So I changed to $replace(%TITLE%,",''') (3 single quotes), now it works. But can't see why...

Because the single quote ' is a special character and has to be "escaped".
You can do it like you alread did with two '' for one ' or four '''' for two ''

1 Like

ahhh, thanks, like in SQL - ok, I didn't know escapings works in MP3tag O:-)

1 Like

Which could have been overcome with a look at the documentation:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.