# I need an ELI5 on removing special characters

**URL:** https://community.mp3tag.de/t/i-need-an-eli5-on-removing-special-characters/55097
**Category:** General Discussion
**Created:** [November 12, 2021, 4:28pm UTC](https://community.mp3tag.de/t/i-need-an-eli5-on-removing-special-characters/55097 "2021-11-12T16:28:55Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Chatt\_a\_Vegas](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/9de053/32.png) [@Chatt\_a\_Vegas](https://community.mp3tag.de/u/Chatt_a_Vegas)
#### Post date: [November 12, 2021, 4:28pm UTC](https://community.mp3tag.de/t/i-need-an-eli5-on-removing-special-characters/55097/1 "2021-11-12T16:28:55Z")

</div>

I have searched and read the "How To/Help" section but I still seem to be missing something.  
I have used MP3Tag for years but I have never needed to use any custom actions. I am trying to add a function to the Rename Files Based on Tags feature.

What I do is have is it simply list TRACK & TITLE. What I need it to also do is remove illegal characters for when I move music to my Android Walkman (example, ?, \* etc).

I kept trying to use $validate and it just kept adding validate to the track name. I saw where I needed to use both validate and replace but I don't understand exactly how to set that up to run as an easy one click and go. I have no idea what I'm doing so any help is appreciated.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [November 12, 2021, 4:42pm UTC](https://community.mp3tag.de/t/i-need-an-eli5-on-removing-special-characters/55097/2 "2021-11-12T16:42:59Z")

</div>

Create an action of the type "Format value" for \_FILENAME  
Format string: `$validate($num(%track%,2) - %title%),_)`  
Try that first as I think that the asterisk is handled by $validate()  
If you need further characters then try  
Format string: `$replace($validate($num(%track%,2) - %title%),_),\,_)`  
(and add all the dubious characters and their replacement after the last underscore, all separated by commas)  
The help says the follwoing:  
Remove invalid characters from file name/file paths

Command: **$validate(filename,to)**  
Example: `$validate(%artist% - %album% - %track% - %title%,-)`  
This example replaces all invalid characters `(/?*"<>|:)` with dashes.

BTW: the same could be achieved with Converter\>Tag-Filename - so if you feel uncomfortable with actions, use the converter.

---

<div class="post-metadata">

### Author: ![Chatt\_a\_Vegas](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/9de053/32.png) [@Chatt\_a\_Vegas](https://community.mp3tag.de/u/Chatt_a_Vegas)
#### Post date: [November 12, 2021, 4:58pm UTC](https://community.mp3tag.de/t/i-need-an-eli5-on-removing-special-characters/55097/3 "2021-11-12T16:58:04Z")

</div>

Thank you, I am still messing up somewhere. I am selecting "rename files based on tags" from the tool bar. But if I input that command what it creates is: "$validate(track title,-)"

Example: 02 Is That Okay? becomes $validate(02 Is That Okay?,-)  
It is my understanding I need to run both validate and replace if I want to remove illegal characters and question marks.

I can get replace to work however. If I enter $replace(%TITLE%,?,) it will create: 02 Is That Okay (having removed the question mark and not leaving the word $replace in the title).

Thanks and sorry for the trouble, I'm just not sure what I'm doing wrong.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [November 12, 2021, 5:01pm UTC](https://community.mp3tag.de/t/i-need-an-eli5-on-removing-special-characters/55097/4 "2021-11-12T17:01:53Z")

</div>

> [@Chatt\_a\_Vegas](#):
>
> "$validate(track title,-)"

This statement has no reference to any field variable. They have to be enclosed in % like %title%.

> [@Chatt\_a\_Vegas](#):
>
> It is my understanding I need to run both validate and replace if I want to remove illegal characters and question marks

No. You see a list of "validated" (=removed or replaced characters) in the list from the help that I quoted.  
Why don't you try one of my suggestions and see whether they come closer to what you want?

---

<div class="post-metadata">

### Author: ![Chatt\_a\_Vegas](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/9de053/32.png) [@Chatt\_a\_Vegas](https://community.mp3tag.de/u/Chatt_a_Vegas)
#### Post date: [November 12, 2021, 5:12pm UTC](https://community.mp3tag.de/t/i-need-an-eli5-on-removing-special-characters/55097/5 "2021-11-12T17:12:07Z")

</div>

Thank you. I think I am seeing where I am going wrong. Let me try to dig with what you have given me.
