# using if function is Tag - File Name

**URL:** https://community.mp3tag.de/t/using-if-function-is-tag-file-name/12695
**Category:** Support
**Created:** [November 15, 2011, 10:51am UTC](https://community.mp3tag.de/t/using-if-function-is-tag-file-name/12695 "2011-11-15T10:51:57Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![ni.va](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@ni.va](https://community.mp3tag.de/u/ni.va)
#### Post date: [November 15, 2011, 10:51am UTC](https://community.mp3tag.de/t/using-if-function-is-tag-file-name/12695/1 "2011-11-15T10:51:57Z")

</div>

Hi

I want to have extensions of files on parent directory if the files are not MP3. Is That Possible??

Here is an example :

1. 

File ext: mp3  
New File name: %albumartist% - %album% %year%\%artist% - %album% - $num(%track%,2).%title%

1. 

File ext: flac  
New File name: %albumartist% - %album% (FLAC) %year%\%artist% - %album% - $num(%track%,2).%title%

---

<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: [November 15, 2011, 11:18am UTC](https://community.mp3tag.de/t/using-if-function-is-tag-file-name/12695/2 "2011-11-15T11:18:50Z")

</div>

You could apply a filter and then rename the files accordingly ...  
%\_tag% HAS FLAC  
filters those with Flac tag ...

---

<div class="post-metadata">

### Author: ![ni.va](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@ni.va](https://community.mp3tag.de/u/ni.va)
#### Post date: [November 15, 2011, 11:51am UTC](https://community.mp3tag.de/t/using-if-function-is-tag-file-name/12695/3 "2011-11-15T11:51:01Z")

</div>

> [@ohrenkino](#):
>
> You could apply a filter and then rename the files accordingly ...  
> %\_tag% HAS FLAC  
> filters those with Flac tag ...

Thanks, but that is not what I want, I want sth to saves me from everytime editing the pattern & having a huge hstory in it. what I meant was using sth like:  
$if(NOT %\_extension% IS mp3,,"("%\_extension%")")

but this doesn't seem to work... am I missing something??

---

<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: [November 15, 2011, 12:22pm UTC](https://community.mp3tag.de/t/using-if-function-is-tag-file-name/12695/4 "2011-11-15T12:22:18Z")

</div>

> [@ni.va](#):
>
> Thanks, but that is not what I want, I want sth to saves me from everytime editing the pattern & having a huge hstory in it. what I meant was using sth like:  
> $if(NOT %\_extension% IS mp3,,"("%\_extension%")")
> 
> but this doesn't seem to work... am I missing something??

an example mask would be:

%artist% \_$if($eql(%\_tag%,'Flac'),%\_tag%,) %album% \_ $num(%track%,3) \_ %title%

for Flac files. The preview should show the result for the first selected file.

---

<div class="post-metadata">

### Author: ![ni.va](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@ni.va](https://community.mp3tag.de/u/ni.va)
#### Post date: [November 15, 2011, 12:38pm UTC](https://community.mp3tag.de/t/using-if-function-is-tag-file-name/12695/5 "2011-11-15T12:38:14Z")

</div>

> [@ohrenkino](#):
>
> an example mask would be:
> 
> %artist% \_$if($eql(%\_tag%,'Flac'),%\_tag%,) %album% \_ $num(%track%,3) \_ %title%
> 
> for Flac files. The preview should show the result for the first selected file.

Thanks So much..... I edited the if function to meet my needs: 😃  
$if($eql(%\_extension%,'Mp3'),,"("$upper(%\_extension%)")")

---

<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: [November 15, 2011, 1:27pm UTC](https://community.mp3tag.de/t/using-if-function-is-tag-file-name/12695/6 "2011-11-15T13:27:38Z")

</div>

> [@ni.va](#):
>
> Hi I want to have extensions of files on parent directory if the files are not MP3. Is That Possible??  
> Here is an example :  
> 1.  
> File ext: mp3  
> New File name: %albumartist% - %album% %year%\%artist% - %album% - $num(%track%,2).%title%  
> 2.  
> File ext: flac  
> New File name: %albumartist% - %album% (FLAC) %year%\%artist% - %album% - $num(%track%,2).%title%

Two proposals ...

**%ALBUMARTIST%' - '%ALBUM%$if($eql(%\_tag%,'FLAC'),' FLAC ',' ')%YEAR%'\'%ARTIST%' - '%ALBUM%' - '$num(%TRACK%,2)'.'%TITLE%****%ALBUMARTIST%' - '%ALBUM%$if($neql($upper(%\_extension%),'MP3'),' '$upper(%\_extension%)' ',' ')%YEAR%'\'%ARTIST%' - '%ALBUM%' - '$num(%TRACK%,2)'.'%TITLE%**

DD.20111115.1538.CET

---

<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:23pm UTC](https://community.mp3tag.de/t/using-if-function-is-tag-file-name/12695/7 "2026-02-09T12:23:26Z")

</div>


