# Problems with pushing tags to filenames

**URL:** https://community.mp3tag.de/t/problems-with-pushing-tags-to-filenames/15758
**Category:** Support
**Created:** [May 22, 2014, 3:54pm UTC](https://community.mp3tag.de/t/problems-with-pushing-tags-to-filenames/15758 "2014-05-22T15:54:24Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bennyboy371](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@bennyboy371](https://community.mp3tag.de/u/bennyboy371)
#### Post date: [May 22, 2014, 3:54pm UTC](https://community.mp3tag.de/t/problems-with-pushing-tags-to-filenames/15758/1 "2014-05-22T15:54:24Z")

</div>

I've searched around and can't find an answer to my issue, so I figured I'd bug you guys. I've only learned how to use this program with just the basics, like pushing the artist to albumartist and some basic IF statements. Right now I have the issue that I'm trying to have one ridiculous format string to rename all my songs via tags. Usually this isn't an issue, but I've run into a problem.

This is my format string:  
E:\Media\Music$if(%albumartist%,%albumartist%,%artist%)$if(%album%,(%year%) %album%,Misc Tracks)$if(%album%,$if(%discnumber%,$num(%discnumber%,1)-,)%track% - ,)%artist% - $if(%title%,%title%,'[untitled]')

As you can see, a lot of IFs. If there's an album artist, use it; otherwise use the artist. If there's an album, use it or put Misc Tracks (if you have a better idea for this folder name, let me know), if there's a disc number, append it to the track number, and if there's no title, call it untitled.

This doesn't seem to work on any tracks that have a slash in the album name, however. Everything else seems mostly fine. In the case of tracks with a backslash in the album name (in this case, Indie/Rock), it freaks out. This example, for instance, should have stayed exactly the same as it was already how I wanted it:

"E:\Media\Music\Various Artists(2013) IndieRock Playlist April (2013)\001 - Tessa Rose Jackson - (All The) King's Horses.mp3" -\>  
"E:\Media\Music\Various Artists(2013) IndieRock Playlist April (2013)\E\Media\Music\Various Artists(2013) IndieRock Playlist April (2013)\001 - Tessa Rose Jackson - (All The) King's Horses.mp3"

As you can see, it appends "E\Media\Music" to its current directory rather than what was intended.

So what exactly can I do about this? I'd like one end-all-be-all format string for my MP3s, and I felt like this was it. I'd appreciate any help or pointers.

---

<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: [May 22, 2014, 4:10pm UTC](https://community.mp3tag.de/t/problems-with-pushing-tags-to-filenames/15758/2 "2014-05-22T16:10:14Z")

</div>

> [@bennyboy371](#):
>
> ... In the case of tracks with a backslash in the album name (in this case, Indie/Rock), it freaks out....

If you know that it is always the files with a backslash in the album name then you could use the  
$validate()  
function around all the expressions dealing with an album.  
So ...$if(%album%,(%year%) %album%,Misc Tracks)  
would become  
$if(%album%,(%year%) $validate(%album%,\_),Misc Tracks)

---

<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: [May 22, 2014, 6:18pm UTC](https://community.mp3tag.de/t/problems-with-pushing-tags-to-filenames/15758/3 "2014-05-22T18:18:47Z")

</div>

> [@bennyboy371](#):
>
> ... Right now I have the issue ... to work on any tracks that have a slash in the album name, however. Everything else seems mostly fine. In the case of tracks with a backslash in the album name (in this case, Indie/Rock), it freaks out. ...  
> This example, for instance, should have stayed exactly the same as it was already how I wanted it:  
> "E:\Media\Music\Various Artists(2013) IndieRock Playlist April (2013)\001 - Tessa Rose Jackson - (All The) King's Horses.mp3" -\>  
> "E:\Media\Music\Various Artists(2013) IndieRock Playlist April (2013)\E\Media\Music\Various Artists(2013) IndieRock Playlist April (2013)\001 - Tessa Rose Jackson - (All The) King's Horses.mp3"  
> As you can see, it appends "E\Media\Music" to its current directory rather than what was intended. ...

I doubt that the shown result string comes from the format string, ... because there is a text part doubled, which cannot be the result from your format string, so it will be a different error.

However ... there are forbidden characters for the filename, read there ...  
[Character remapping during conversion?](https://community.mp3tag.de/t/13037/5)

You can use one of the functions $replace or $regexp or $validate to replace forbidden characters with allowed character/s or remove them wholly.

Try out this format string ...

**$validate('E:\Media\Music\'$if2(%ALBUMARTIST%,%ARTIST%)'\'$if(%ALBUM%,'('%YEAR%') '%ALBUM%,'Misc Tracks')'\'$if(%ALBUM%,[$num(%DISCNUMBER%,2)'-']%TRACK%' - ',)%ARTIST%' - '$if2(%TITLE%,'[untitled]'),'~')**

DD.20140522.2223.CEST

---

<div class="post-metadata">

### Author: ![bennyboy371](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@bennyboy371](https://community.mp3tag.de/u/bennyboy371)
#### Post date: [May 22, 2014, 6:35pm UTC](https://community.mp3tag.de/t/problems-with-pushing-tags-to-filenames/15758/4 "2014-05-22T18:35:50Z")

</div>

Outstanding! Thanks guys. This did the trick. I wasn't aware of validate or replace, but I'll sure be using them in the future. Regexp is still a bit over my head, so I think I'll steer clear.

---

<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: [February 9, 2026, 12:25pm UTC](https://community.mp3tag.de/t/problems-with-pushing-tags-to-filenames/15758/5 "2026-02-09T12:25:04Z")

</div>


