How Do I replace ? and / with _

I'm looking to replace the ? to _ when I convert the tag to filename. Also how do I replace the / with _ when I convert the tag to filename.

Example: Maroon 5 - Secret / Ain't No Sunshine
To Filename: Maroon 5 - Secret _ Ain't No Sunshine

           Maroon 5 - How Are You?

To Maroon 5 - How Are You_

I only use the / to separate song titles in a melody

Thanks.

Use $validate(filename string,_)
This replaces the invalide filename characters /?*"<>|: with _

[quote name='compubob' post='50254']
I'm looking to replace the ? to _ when I convert the tag to filename. Also how do I replace the / with _ when I convert the tag to filename.

Example: Maroon 5 - Secret / Ain't No Sunshine
To Filename: Maroon 5 - Secret _ Ain't No Sunshine

           Maroon 5 - How Are You?

To Maroon 5 - How Are You_

I only use the / to separate song titles in a melody

Thanks.
[/quote

How and where do I use this script?

How and where do I use this script. Thank You for your help!

What about using it in convert Tag to Filename as in your original question



Thank You All For The Help. Now this program works exactly as I need it. :smiley:

This is a great question. I use invalid characters in the actual tag fields, but always have to replace them in file names. I use ^ instead of _, though.

Is there any way to get the program to replace invalid characters with ^?

... and already answered.

You can take the Mp3tag manual and look for scripting functions ...
https://docs.mp3tag.de/scripting
$replace()
$validate()
... both functions can do the replacement of characters in their special way.

DD.20101113.1756.CET