# Format String struture ? Rename folder and files files ?

**URL:** https://community.mp3tag.de/t/format-string-struture-rename-folder-and-files-files/11038
**Category:** Support
**Created:** [October 31, 2010, 7:28pm UTC](https://community.mp3tag.de/t/format-string-struture-rename-folder-and-files-files/11038 "2010-10-31T19:28:15Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sept2010](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/edb3f5/32.png) [@sept2010](https://community.mp3tag.de/u/sept2010)
#### Post date: [October 31, 2010, 7:28pm UTC](https://community.mp3tag.de/t/format-string-struture-rename-folder-and-files-files/11038/1 "2010-10-31T19:28:15Z")

</div>

Hi guys,

Here is a example structure of one of my albums before tagging with discogs.

Album:  
VA\_-\_Hed\_Kandi\_The\_Mix\_Summer\_2008-3CD-2008-LiR

Tracks:  
101 - Adele - Cold Shoulder (Out Of Office Remix).mp3  
..  
104 - Syke'n'Sugarstarr Pres. CeCe Rogers - No Love Lost (Extended Mix)  
..  
309 - ATFC & Ghostcopy - Don't Look Back

--

I tagged the album and files with discogs. Getting the following information

Artist:  
Adele

Title:  
Cold Shoulder (Out Of Office Remix) 1-10

Album Artist:  
Various (added this myself)

Album:  
Hed Kandi The Mix: Summer 2008

Disc:  
1

Year:  
2008/07

Publisher:  
Hed Kandi Records

I tagged with this command

VA\_-_%publisher%-%album%_%year%\%discnumber%$num(%track%,2)-$lower(%artist%_-_%title%)

Result:  
\VA\_-_Hed Kandi Records-Hed Kandi The Mix Summer 2008\_200807\101-adele_-\_cold shoulder (out of office remix) 1-01.mp3"

Wanted result:  
\VA\_-_Hed\_Kandi\_Records-Hed\_Kandi\_The\_Mix\_Summer\_2008\_2008.07\101-adele_-_cold\_shoulder_(out\_of\_office\_remix)\_1-01.mp3"

So I want to replace " " with "\_". And for artist and songs containing "&" "´" ...etc, I haven´t figure out any solution for this either ?

The same is then discogs is getting year result in 2008/07. How do you solve this ?

Is is possible to create an .nfo, .m3u and .sfv at the same time ??

Regards  
Magnus

---

<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: [October 31, 2010, 7:59pm UTC](https://community.mp3tag.de/t/format-string-struture-rename-folder-and-files-files/11038/2 "2010-10-31T19:59:00Z")

</div>

> [@sept2010](#):
>
> I tagged with this command
> 
> VA\_-_%publisher%-%album%_%year%\%discnumber%$num(%track%,2)-$lower(%artist%_-_%title%)
> 
> Result:  
> \VA\_-_Hed Kandi Records-Hed Kandi The Mix Summer 2008\_200807\101-adele_-\_cold shoulder (out of office remix) 1-01.mp3"
> 
> Wanted result:  
> \VA\_-_Hed\_Kandi\_Records-Hed\_Kandi\_The\_Mix\_Summer\_2008\_2008.07\101-adele_-_cold\_shoulder_(out\_of\_office\_remix)\_1-01.mp3"
> 
> So I want to replace " " with "\_". And for artist and songs containing "&" "´" ...etc, I haven´t figure out any solution for this either ?
> 
> The same is then discogs is getting year result in 2008/07. How do you solve this ?

[https://docs.mp3tag.de/scripting](https://docs.mp3tag.de/scripting)

these are the things you need:  
for replacement of " " with "_":  
$replace(string, ,_)

for replacement of invalide filename characters:  
$validate(filename,\_)

for shortening the year to four diggits.  
$num(%year%,4)

i think this would be your command:  
$validate($replace(VA\_-_%publisher%-%album%_$num(%year%,4)\%discnumber%$num(%track%,2)-$lower(%artist%_-_%title%), ,_),_)

you know that you can also format directory names without creating and moving all files in a new directory?  
action: Format Value  
field: _DIRECTORY  
format string: $validate($replace(VA_-_%publisher%-%album%_$num(%year%,4), ,_),_)

combine this with format filename in a action group:  
action: Format Value  
field: _FILENAME  
format string: $validate($replace(%discnumber%$num(%track%,2)-$lower(%artist%_-_%title%), ,_),\_)

will save you some time

---

<div class="post-metadata">

### Author: ![sept2010](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/edb3f5/32.png) [@sept2010](https://community.mp3tag.de/u/sept2010)
#### Post date: [October 31, 2010, 9:49pm UTC](https://community.mp3tag.de/t/format-string-struture-rename-folder-and-files-files/11038/3 "2010-10-31T21:49:17Z")

</div>

Thx a lot pone!!

This really helped me out a lot. Saved me lot of time. The more I look into mp3tag the more I see the potensial.

Gonna take a look at the link you sent me 🙂

Is there any built in function for handling .nfo and .m3u ?

Regards  
Magnus

---

<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 2, 2010, 11:16pm UTC](https://community.mp3tag.de/t/format-string-struture-rename-folder-and-files-files/11038/4 "2010-11-02T23:16:04Z")

</div>

> [@sept2010](#):
>
> Is there any built in function for handling .nfo and .m3u ?

You can create playlists and with export also nfo files.

But if you think of importing information from these files into your audiofiles, rather not.

If you rename them to .txt files, you could use the Text File - Tag converter, but:

- you could use that to name your audiofiles as they are listed in a .m3u file, but it's much easier to create a new .m3u file acording to the existing file names.
- you can get only the tracknames out of .nfo files (the ones which are typically spreaded with so called scene releases). for that you have to delete all information before the tracknames.

Mp3Tag Text File - Tag converter can only convert text when each line represents one audiofile.

---

<div class="post-metadata">

### Author: ![sept2010](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/edb3f5/32.png) [@sept2010](https://community.mp3tag.de/u/sept2010)
#### Post date: [November 4, 2010, 8:11pm UTC](https://community.mp3tag.de/t/format-string-struture-rename-folder-and-files-files/11038/5 "2010-11-04T20:11:40Z")

</div>

All right thx. I´ll give it a try.

> [@pone](#):
>
> You can create playlists and with export also nfo files.
> 
> But if you think of importing information from these files into your audiofiles, rather not.
> 
> If you rename them to .txt files, you could use the Text File - Tag converter, but:
> 
> - you could use that to name your audiofiles as they are listed in a .m3u file, but it's much easier to create a new .m3u file acording to the existing file names.
> - you can get only the tracknames out of .nfo files (the ones which are typically spreaded with so called scene releases). for that you have to delete all information before the tracknames.
> 
> Mp3Tag Text File - Tag converter can only convert text when each line represents one audiofile.

---

<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:22pm UTC](https://community.mp3tag.de/t/format-string-struture-rename-folder-and-files-files/11038/6 "2026-02-09T12:22:39Z")

</div>


