# Minor Issue with /'s when renaming files based on tags

**URL:** https://community.mp3tag.de/t/minor-issue-with-s-when-renaming-files-based-on-tags/56781
**Category:** Mac
**Created:** [March 24, 2022, 4:56am UTC](https://community.mp3tag.de/t/minor-issue-with-s-when-renaming-files-based-on-tags/56781 "2022-03-24T04:56:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tagmaster](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/d26b3c/32.png) [@tagmaster](https://community.mp3tag.de/u/tagmaster)
#### Post date: [March 24, 2022, 4:56am UTC](https://community.mp3tag.de/t/minor-issue-with-s-when-renaming-files-based-on-tags/56781/1 "2022-03-24T04:56:35Z")

</div>

Hello. This is my favourite preset when converting tags to filenames as this both creates directories for the album, and renames the file to the format I want. This is my preferred template:

%ALBUMARTIST% - %ALBUM% '['%YEAR%']'/$num(%track%,2). %artist% - %title%

This works flawlessly in windows as windows simply omits the "/" which sometimes occurs in 2 and 3 track EP's. My problem now is, I've recently switched to macOS, and I want to use the same format. While this template works mostly flawlessly, there's the odd 2 and 3 track EP with "/" in the album field. What mp3tag for macOS does instead is it cuts up the name of the album, creating several sub-directories, depending on how many "/" are in the album name. It's a minor inconvenience with those albums and I hope this gets resolved soon.

---

<div class="post-metadata">

### Author: ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)
#### Post date: [March 24, 2022, 5:45am UTC](https://community.mp3tag.de/t/minor-issue-with-s-when-renaming-files-based-on-tags/56781/2 "2022-03-24T05:45:17Z")

</div>

MP3Tag uses slashes in format strings for filenaming to create subfolders. You use this feature yourself in your format string.  
If a tagfield contains a slash your have to replace it woth another character for the filename.  
It is not a good idea anyway to use the slash in the filenames of MacOs for interoperability.  
You have to replace slashes with another character, e.g  
%ALBUMARTIST% - **$replace(%ALBUM%,/,)**'['%YEAR%']'/$num(%track%,2). %artist% - %title%

In my example the slash is replaced with nothing.  
Have a look at the help for the scripting funktion $replace().

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [March 24, 2022, 6:43am UTC](https://community.mp3tag.de/t/minor-issue-with-s-when-renaming-files-based-on-tags/56781/3 "2022-03-24T06:43:04Z")

</div>

Please also see [Preferences → General → Filenames](https://community.mp3tag.de/t/preferences-and-configuration/56296#filenames-5) where you can **Replace invalid NTFS characters** on field lookup.

> Enabling the automatic replacement also prevents folder creation when using the converter **Tag - Filename** with fields that contain the forward slash character `/`.
