Replace specific character in tags and filename

Hello dear Mp3tag community,

I purchased old Pioneer CDJ-200 turntables to practice mixing in my bedroom. It supports MP3 CDs, I burned a few and found out that the players stop with an 8304 error when the filename or any of the ID3 tag fields (mostly Artist, Title and Genre) contains "&" symbol. As the latest firmware update doesn't solve this problem and Pioneer won't give a f**k for a 15 years old legacy device, I'll have to adjust and edit the filenames and tags.

I think regexp is the thing I want but I'm not familiar with it.

Can someone please write me a line that replaces "&" with "and" anywhere in the filename or ID3 tag field(s)?

And one more quick question:
My tag field INITIALKEY contains values like "1A", "5B", "11A". How to convert them with a "0" in front of those values with a single number before the letter A or B? "01A", "05B", "11A"

I'd appreciate any help. :slight_smile:

Use an action of the type "Format value" for _FILENAME
Format string: $replace(%_filename%,&,and)
I would not replace the & in the tags.
If you create new filenames for that player, enclose the whole pattern that you use for the filename with the $replace() function so that the filename format string may look like this:

1 Like

Use an action of the type "Format value" for INITIALKEY
Format string: $regexp(%initialkey%,^(\d.)$,0$1)

Thanks, mate, will give it a try this evening.

Can I ask why? I have to do it to avoid error on my CDJs. I see no problem there because I'm editing the filename and tags not for my original files in library but the copies made only for burning to CD which I delete afterwards.

I just fancy to keep the data in the tags as close to the original as possible...
Filenames have so many restrictions in respect to valid characters that the only criterion that they have to fulfill is: be unique.
So why should any other tag "suffer" from the restrictions for the filenames?

Unfortunately the error appears even with a good filename (without "&") if there's "&" somewhere in the artist, title, album or genre field. But as I said - no problem cause I'm creating copies to edit, burn and delete afterwards.

I think if you substitute %_filename% with %_all% then the action should replace all ampersands everywhere.
If that does not work, use %_tag% for all the tag data.

Replacing "&" with "and" works excellent.


this one writes [ SYNTAX ERROR IN FORMATTING ]` in the field. I'm too dumb to debug. :frowning:

should read

1 Like

I have to correct this:
It is only possible to use _TAG or _ALL for actions like "Replace" or "Replace with regular expression". Using %_tag% only shows the tag version.

Thanks for the quick and detailed help @ohrenkino, I got what (I thought) I needed!

In the end I ruined few more CDs to find out that "&" wasn't the actual problem. Pioneer CDJ-200 and possibly other players from the same generation doesn't like MP3 files that have Xing stream embedded. I solved it by downloading MP3 Diags and removing all Xing streams from the files before writing them to the CD.