# Here's a Nice Tag 2 File Rename

**URL:** https://community.mp3tag.de/t/heres-a-nice-tag-2-file-rename/14006
**Category:** General Discussion
**Created:** [October 17, 2012, 3:24am UTC](https://community.mp3tag.de/t/heres-a-nice-tag-2-file-rename/14006 "2012-10-17T03:24:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pollus](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/96bed5/32.png) [@pollus](https://community.mp3tag.de/u/pollus)
#### Post date: [October 17, 2012, 3:24am UTC](https://community.mp3tag.de/t/heres-a-nice-tag-2-file-rename/14006/1 "2012-10-17T03:24:01Z")

</div>

Here's a Nice Tag 2 File Rename

E:\MP3Tag\$if(%compilation%,Compilations,Discography\$if2(%albumartist%,%artist%))\\%album%\$if($isdigit(%discnumber%),%discnumber%.,)$if($grtr(%track%,0),$num(%track%,2) - ,)%title%
## This will create 2 main folders under MP3Tag Discography Compilations Then, the organisation will be different under each.

You should use a computed column to make sure you filter out files that are not good candidate (where the number is 0)

Here's my Candidate Colum that compute if a file has an artist OR artistalbum AND album AND title

$mul($mul($len(%artist%%albumartist%),$len(%album%)),$len(%title%))

---

<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: [October 17, 2012, 4:13am UTC](https://community.mp3tag.de/t/heres-a-nice-tag-2-file-rename/14006/2 "2012-10-17T04:13:03Z")

</div>

> [@pollus](#):
>
> Here's a Nice Tag 2 File Rename ...  
> You should use a computed column to make sure you filter out files that are not good candidate (where the number is 0) ...

pollus, thank you for sharing.

So this format string ...

**'E:\MP3Tag\'$if(%COMPILATION%,'Compilations','Discography\'$if2(%ALBUMARTIST%,%ARTIST%))'\'%ALBUM%'\'$if($isdigit(%DISCNUMBER%),%DISCNUMBER%'.',%DUMMY%)$if($grtr(%TRACK%,0),$num(%TRACK%,2)' - ',%DUMMY%)%TITLE%**

... will create those path strings ...

E:\MP3Tag\Compilations\Album\Title  
E:\MP3Tag\Compilations\Album\01 - Title  
E:\MP3Tag\Compilations\Album\1.01 - Title

E:\MP3Tag\Discography\Artist\Album\Title  
E:\MP3Tag\Discography\Artist\Album\01 - Title  
E:\MP3Tag\Discography\Artist\Album\1.01 - Title

This is an interesting approach to create a value for a 'computed candidate column' ...

**$mul($mul($len(%ARTIST%%ALBUMARTIST%),$len(%ALBUM%)),$len(%TITLE%))**

... and will create numbers in the range between 0 and any other computed number.

Using boolean functional operators it looks like ...

**$if($and($or(%ARTIST%,%ALBUMARTIST%),%ALBUM%,%TITLE%),'1','0')**

... this creates the digits 1 resp. 0 ...

... or ...

**$if($and($or(%ARTIST%,%ALBUMARTIST%),%ALBUM%,%TITLE%),'Y',%DUMMY%)**

... this creates the character 'Y' resp. nothing.

DD.20121017.0812.CEST

---

<div class="post-metadata">

### Author: ![jonadelman](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@jonadelman](https://community.mp3tag.de/u/jonadelman)
#### Post date: [December 31, 2012, 10:31am UTC](https://community.mp3tag.de/t/heres-a-nice-tag-2-file-rename/14006/3 "2012-12-31T10:31:50Z")

</div>

Hi. This is my first post, but I have been searching for this for a long time. It appears as though what you are doing here is what I want to do, but I'm not sure what to do with the string and column. For one thing, where would I enter those. For another, if I do that, is it going to move all the mp3 files from where they are to totally new location?

All I'm trying to do is to be able to have compilations on my phone without the player splitting it into a million artists. I can get it to stay together if i just sort by album, but sorting by album doesn't make sense when there are so many albums. I can't believe how difficult it is to do what iTunes does (i.e., sort "Album by Artist" on my android phone. Argh.

Thanks for your help.
