# Replace Characters in Rename

**URL:** https://community.mp3tag.de/t/replace-characters-in-rename/1644
**Category:** General Discussion
**Created:** [January 22, 2005, 3:59pm UTC](https://community.mp3tag.de/t/replace-characters-in-rename/1644 "2005-01-22T15:59:45Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![tberman333](https://community.mp3tag.de/user_avatar/community.mp3tag.de/tberman333/32/51_2.png) [@tberman333](https://community.mp3tag.de/u/tberman333)
#### Post date: [January 22, 2005, 3:59pm UTC](https://community.mp3tag.de/t/replace-characters-in-rename/1644/1 "2005-01-22T15:59:45Z")

</div>

I was thinking it would be helpful to set your own "standards" for how to replace invalid characters when renaming files from the tag.

For example, I have a lot of live shows on CD and when two songs flow into each-other I put a '\>' after the title to show that it flows to the next song...

Then, everythime I rename it aways stops on every song with a '\>' and askes me if it can use a space instead... I actaully would rather it use another character, such as ']'. Also when there is a '?' I would like to just remove it rather than replacing it with a space. It would be great if I can set something in mp3tag that says always replace '\>' with ']' or '?' with [no space] or something similar.

Just my thought...

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [January 22, 2005, 4:10pm UTC](https://community.mp3tag.de/t/replace-characters-in-rename/1644/2 "2005-01-22T16:10:12Z")

</div>

You can use the scripting functions in "Tag-\>File name".  
For example:  
%artist%-$replace(%title%,\<,'[')

---

<div class="post-metadata">

### Author: ![tberman333](https://community.mp3tag.de/user_avatar/community.mp3tag.de/tberman333/32/51_2.png) [@tberman333](https://community.mp3tag.de/u/tberman333)
#### Post date: [January 22, 2005, 10:39pm UTC](https://community.mp3tag.de/t/replace-characters-in-rename/1644/3 "2005-01-22T22:39:52Z")

</div>

> [@](#):
>
> You can use the scripting functions in "Tag-\>File name".  
> For example:  
> %artist%-$replace(%title%,\<,'[')
> 
> \<{POST\_SNAPBACK}\>

Very cool... I will try that out! Thanks for the quick reply!

---

<div class="post-metadata">

### Author: ![beaker](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/ecb155/32.png) [@beaker](https://community.mp3tag.de/u/beaker)
#### Post date: [January 23, 2005, 12:06am UTC](https://community.mp3tag.de/t/replace-characters-in-rename/1644/4 "2005-01-23T00:06:54Z")

</div>

I have an action called "Special Characters" that replaces all those characters that can't be used in a filename.

---

<div class="post-metadata">

### Author: ![tberman333](https://community.mp3tag.de/user_avatar/community.mp3tag.de/tberman333/32/51_2.png) [@tberman333](https://community.mp3tag.de/u/tberman333)
#### Post date: [January 23, 2005, 12:40am UTC](https://community.mp3tag.de/t/replace-characters-in-rename/1644/5 "2005-01-23T00:40:18Z")

</div>

The problem with using an action is that I want to keep the special characters in the title and just replace them with something relevent in the file name...

As far as using the $replace funtion that Dano mentioned, does anyone know how I could replace all special character in one line rather than just one at a time..

What I mean is, I would like to have the files named as artist - title with a replace that changes "\>" to "]" and "/" to "-" and "?" to "", etc.

Thanks.

---

<div class="post-metadata">

### Author: ![Sebastian\_Mares](https://community.mp3tag.de/user_avatar/community.mp3tag.de/sebastian_mares/32/9285_2.png) [@Sebastian\_Mares](https://community.mp3tag.de/u/Sebastian_Mares)
#### Post date: [January 23, 2005, 7:55am UTC](https://community.mp3tag.de/t/replace-characters-in-rename/1644/6 "2005-01-23T07:55:47Z")

</div>

> [@](#):
>
> The problem with using an action is that I want to keep the special characters in the title and just replace them with something relevent in the file name...
> 
> As far as using the $replace funtion that Dano mentioned, does anyone know how I could replace all special character in one line rather than just one at a time..
> 
> What I mean is, I would like to have the files named as artist - title with a replace that changes "\>" to "]" and "/" to "-" and "?" to "", etc.
> 
> Thanks.
> 
> \<{POST\_SNAPBACK}\>

The only way I can think of right now would be creating an action set which copies the artist and the title into a new ID3v2 field, then replaces all invalid characters, generates a file name based on that field and finally deletes the field.  
The Format values action type will help here. 🙂

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [January 23, 2005, 8:32am UTC](https://community.mp3tag.de/t/replace-characters-in-rename/1644/7 "2005-01-23T08:32:23Z")

</div>

Actions can also be used for renaming.  
Just select _FILENAME as field on "format value" action.  
For multiple replaces in one line:  
$replace($replace($replace(%title%,/,_),?,_),:,_)

---

<div class="post-metadata">

### Author: ![Sebastian\_Mares](https://community.mp3tag.de/user_avatar/community.mp3tag.de/sebastian_mares/32/9285_2.png) [@Sebastian\_Mares](https://community.mp3tag.de/u/Sebastian_Mares)
#### Post date: [January 23, 2005, 5:35pm UTC](https://community.mp3tag.de/t/replace-characters-in-rename/1644/8 "2005-01-23T17:35:58Z")

</div>

> [@](#):
>
> Actions can also be used for renaming.  
> Just select _FILENAME as field on "format value" action.  
> For multiple replaces in one line:  
> $replace($replace($replace(%title%,/,_),?,_),:,_)
> 
> \<{POST\_SNAPBACK}\>

Ah, totally forgot that you can use nested $replace. \>\_\<

---

<div class="post-metadata">

### Author: ![tberman333](https://community.mp3tag.de/user_avatar/community.mp3tag.de/tberman333/32/51_2.png) [@tberman333](https://community.mp3tag.de/u/tberman333)
#### Post date: [January 24, 2005, 2:53am UTC](https://community.mp3tag.de/t/replace-characters-in-rename/1644/9 "2005-01-24T02:53:34Z")

</div>

Perfect... thanks for all the help!
