Replace two single quotes with one double quote

Hi, all.

Just finished beating my head against the wall for something trivial, so I thought I'd post in case someone else comes up against it.

The scenario:

I have an action that uses the FILENAME to create the TITLE tag. It gets applied last, after case conversion and other actions.

As double quotes are illegal in file names, I use two single quotes to represent things like:
07 - More Than This (7'' Version)

but I want to use one double quote (") in the TITLE tag. I added a REPLACE action to deal with it, but I added it to my list of "standard" actions, which are applied to ALL fields and run before the last "Convert FILENAME to TITLE tag" action. That had the effect of undoing the REPLACE.

Separating the "Single Quotes to Double Quote" REPLACE to its own action and placing it after the "Convert FILENAME to TITLE tag" action caused my head to stop hurting :wink:

I don't know whether this helps much, but I always handle this in the opposite direction. That is, I always set my TITLE to be whatever I like (since no characters are off limits), then I use a $replace() function to replace illegal characters in a Rename File action group. The Rename File action group is always run at the end of the standard check list when I do anything.

Action type: Format value
Format string: $num(track%,2) $replace(%title%,/, - ,?,,",'',,-,:,-,*,-,<,-,>,-,|,-)

Note: Mp3tag has a $validate() function, which replaces all illegal filename characters with dashes. I choose to use the $replace() function shown above to have more control, such as changing double-quotes to two single quotes.

BTW, the above action may give you a hint at a different way of doing it. Instead of using a Replace action, you might find it easier using a $replace() function within a Format Value action.

Action type: Format value
Field: TITLE
Format string: $replace(%title%,'',")

I recommend to use a workflow that works from ... filename/websource/typing ... to tag-field to filename.
At the very end of the work chain the filename can be assembled from the tag-field values.
Special characters, which are forbidden within the filesystem, can be replaced or removed without touching already well formed tag-fields.

Mp3tag supports unicode characters and some filesystems support unicode characters in filenames.
Therefore a bunch of special characters are allowed in filenames too.

For example see ...

The prime symbol ( ′ ), double prime symbol ( ″ ), and triple prime symbol ( ‴ ), etc., are used to designate several different units, and for various other purposes in mathematics, the sciences, linguistics and music. The prime symbol should not be confused with the apostrophe, single quotation mark, acute accent or grave accent; the double prime should not be confused with the double quotation mark,[1] the ditto mark, or the letter double apostrophe.

On the filesystem NTFS it is possible to create a filename having unicode characters.
For example:
This song has 3′ 5″ music (7″ Version).mp3


Be aware of the pseudo tag-fields _ALL and _TAG and their different scope.
_ALL includes the filename, _TAG excludes the filename.


Replace two single quotation marks (single apostrophes) with one double quotation mark ... $replace(%TITLE%,'''','"') ... or ... $replace(%TITLE%,'''',") ... or ... $replace(%TITLE%,$char(39)$char(39),'"') ... or ... $replace(%TITLE%,$char(39)$char(39),$char(34))