# Special characters substitute mapping to filename from "tag to filename" convert

**URL:** https://community.mp3tag.de/t/special-characters-substitute-mapping-to-filename-from-tag-to-filename-convert/49860
**Category:** Support
**Created:** [August 9, 2020, 4:46am UTC](https://community.mp3tag.de/t/special-characters-substitute-mapping-to-filename-from-tag-to-filename-convert/49860 "2020-08-09T04:46:00Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![fractal](https://community.mp3tag.de/user_avatar/community.mp3tag.de/fractal/32/7968_2.png) [@fractal](https://community.mp3tag.de/u/fractal)
#### Post date: [August 9, 2020, 4:46am UTC](https://community.mp3tag.de/t/special-characters-substitute-mapping-to-filename-from-tag-to-filename-convert/49860/1 "2020-08-09T04:46:00Z")

</div>

Hi, first sorry if this already was asked before 😅  
I was using the batch convert tag to filename and faced with some tags with special characters like ": \ | ?" that I guess none file system support, I'd like to know if there is a way to map substitutes to them when we use this kind of bulk function.

I'm asking this because I've seen such feature in the other software "Exact Audio Copy" and I thought that would be perfect for MP3Tag.

Thanks

---

<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: [August 9, 2020, 8:38am UTC](https://community.mp3tag.de/t/special-characters-substitute-mapping-to-filename-from-tag-to-filename-convert/49860/2 "2020-08-09T08:38:21Z")

</div>

There is the function $validate()  
(see the help: [Scripting Functions – Mp3tag Documentation](https://docs.mp3tag.de/scripting))  
but please note the `\` is a valid character to create folder structures, see the HowTos:  
[Converters to rename files or to import tags - #2 by Florian](https://community.mp3tag.de/t/converters-to-rename-files-or-to-import-tags/8016/2)

---

<div class="post-metadata">

### Author: ![fractal](https://community.mp3tag.de/user_avatar/community.mp3tag.de/fractal/32/7968_2.png) [@fractal](https://community.mp3tag.de/u/fractal)
#### Post date: [August 9, 2020, 4:44pm UTC](https://community.mp3tag.de/t/special-characters-substitute-mapping-to-filename-from-tag-to-filename-convert/49860/3 "2020-08-09T16:44:32Z")

</div>

_yeah, sorry, I meant the forward slash "/" 🤦‍♂️_

that's exactly what I was looking for, thank you!  
So the syntax that I used for two replacements was: "$replace($replace(%title%,:,;),/,-)", is that correct? It worked here 🤷‍♂️

before

 ![image](https://community.mp3tag.de/uploads/default/original/2X/3/337682bed0e46d6a37c8ceaaa85f0645b8d6ddd4.png)  
after  
 ![image](https://community.mp3tag.de/uploads/default/original/2X/4/4aedcf50fa20fba1477b9af9cf0acb40df9b2933.png)

(changes specially to file 09)

again, thanks 😃

---

<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: [August 9, 2020, 4:58pm UTC](https://community.mp3tag.de/t/special-characters-substitute-mapping-to-filename-from-tag-to-filename-convert/49860/4 "2020-08-09T16:58:50Z")

</div>

> [@fractal](#):
>
> So the syntax that I used for two replacements was: "$replace($replace(%title%,:,;),/,-)",

I think you could simply use the $replace() that replaces the / with a -.  
Unless you use $validate() and tell MP3tag to use a special character, all invalid characters for filenames would simply be left out. So there is no need to treat the `:`

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [September 8, 2020, 5:07pm UTC](https://community.mp3tag.de/t/special-characters-substitute-mapping-to-filename-from-tag-to-filename-convert/49860/5 "2020-09-08T17:07:16Z")

</div>

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