# How Do I replace ? and / with \_

**URL:** https://community.mp3tag.de/t/how-do-i-replace-and-with/11106
**Category:** Support
**Created:** [November 10, 2010, 10:16pm UTC](https://community.mp3tag.de/t/how-do-i-replace-and-with/11106 "2010-11-10T22:16:37Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![compubob](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@compubob](https://community.mp3tag.de/u/compubob)
#### Post date: [November 10, 2010, 10:16pm UTC](https://community.mp3tag.de/t/how-do-i-replace-and-with/11106/1 "2010-11-10T22:16:37Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [November 10, 2010, 10:29pm UTC](https://community.mp3tag.de/t/how-do-i-replace-and-with/11106/2 "2010-11-10T22:29:42Z")

</div>

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

---

<div class="post-metadata">

### Author: ![compubob](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@compubob](https://community.mp3tag.de/u/compubob)
#### Post date: [November 11, 2010, 5:03am UTC](https://community.mp3tag.de/t/how-do-i-replace-and-with/11106/3 "2010-11-11T05:03:26Z")

</div>

[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?

---

<div class="post-metadata">

### Author: ![compubob](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@compubob](https://community.mp3tag.de/u/compubob)
#### Post date: [November 11, 2010, 5:05am UTC](https://community.mp3tag.de/t/how-do-i-replace-and-with/11106/4 "2010-11-11T05:05:45Z")

</div>

> [@pone](#):
>
> Use $validate(filename string,\_)  
> This replaces the invalide filename characters /?\*"\<\>|: with \_

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

---

<div class="post-metadata">

### Author: ![mjcm](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/9d8465/32.png) [@mjcm](https://community.mp3tag.de/u/mjcm)
#### Post date: [November 11, 2010, 8:02am UTC](https://community.mp3tag.de/t/how-do-i-replace-and-with/11106/5 "2010-11-11T08:02:30Z")

</div>

> [@compubob](#):
>
> 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

> [@compubob](#):
>
>  I'm looking to replace the ? to \_ when I convert the tag to filename. 

![](https://community.mp3tag.de/uploads/default/original/2X/2/231739b1f077464cac6c17e4152317d06335b0ee.jpg)

![](https://community.mp3tag.de/uploads/default/original/2X/2/231739b1f077464cac6c17e4152317d06335b0ee.jpg)

---

<div class="post-metadata">

### Author: ![compubob](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@compubob](https://community.mp3tag.de/u/compubob)
#### Post date: [November 11, 2010, 7:39pm UTC](https://community.mp3tag.de/t/how-do-i-replace-and-with/11106/6 "2010-11-11T19:39:22Z")

</div>

> [@Mike\_nl](#):
>
> What about using it in convert Tag to Filename as in your original question
> 
> ![](https://community.mp3tag.de/uploads/default/original/2X/2/231739b1f077464cac6c17e4152317d06335b0ee.jpg)

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

---

<div class="post-metadata">

### Author: ![0LD3\_DUDE](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/0/3e96dc/32.png) [@0LD3\_DUDE](https://community.mp3tag.de/u/0LD3_DUDE)
#### Post date: [November 13, 2010, 3:16pm UTC](https://community.mp3tag.de/t/how-do-i-replace-and-with/11106/7 "2010-11-13T15:16:58Z")

</div>

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 ^?

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [November 13, 2010, 3:57pm UTC](https://community.mp3tag.de/t/how-do-i-replace-and-with/11106/8 "2010-11-13T15:57:32Z")

</div>

> [@0LD3 DUDE](#):
>
> This is a great question. ...

... and already answered.

> [@0LD3 DUDE](#):
>
> ... 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 ^?

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

DD.20101113.1756.CET

---

<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: [November 18, 2024, 1:54pm UTC](https://community.mp3tag.de/t/how-do-i-replace-and-with/11106/9 "2024-11-18T13:54:51Z")

</div>

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