# CREATE DIRECTORY IF

**URL:** <https://community.mp3tag.de/t/create-directory-if/19670>\
**Category:** Support\
**Created:** [January 7, 2018, 2:04pm UTC](https://community.mp3tag.de/t/create-directory-if/19670 "2018-01-07T14:04:24Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![faisdlair](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/c4cdca/32.png) [@faisdlair](https://community.mp3tag.de/u/faisdlair)\
**Post date:** [January 7, 2018, 2:04pm UTC](https://community.mp3tag.de/t/create-directory-if/19670/1 "2018-01-07T14:04:24Z")

</div>

Hi

One more action i'de like to set

If files are MP3 then transfer them to "X:\Shared Music\MP3"  
or  
If files are FLAC then transfer them to"X:\Shared Music\FLAC"  
or  
If files are DSD then transfer them to"X:\Shared Music\DSD"

thank you

Martin

---

<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:** [January 7, 2018, 2:20pm UTC](https://community.mp3tag.de/t/create-directory-if/19670/2 "2018-01-07T14:20:28Z")

</div>

I am not sure about those dsd files - but I think you can use the information variable %\_tag\_read%.  
An action of the type "Format value" for \_Filename:  
Format string: X:\Shared Music$replace(%\_tag\_read%,ID3V2.3,MP3,ID3V1,MP3,FLAC,FLAC,DSD,DSD)\%\_filename%

As I said: check the dsd files and see what it says for %\_tag\_read% and then enter that for the first DSD in the replace-expression.

---

<div class="post-metadata">

**Author:** ![faisdlair](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/c4cdca/32.png) [@faisdlair](https://community.mp3tag.de/u/faisdlair)\
**Post date:** [January 7, 2018, 2:32pm UTC](https://community.mp3tag.de/t/create-directory-if/19670/3 "2018-01-07T14:32:20Z")

</div>

> [@ohrenkino](#):
>
> I am not sure about those dsd files - but I think you can use the information variable %\_tag\_read%.  
> An action of the type "Format value" for \_Filename:  
> Format string: X:\Shared Music$replace(%\_tag\_read%,ID3V2.3,MP3,ID3V1,MP3,FLAC,FLAC,DSD,DSD)\%\_filename%
> 
> As I said: check the dsd files and see what it says for %\_tag\_read% and then enter that for the first DSD in the replace-expression.

ok look what i have

DSD is ID3V2.3

---

<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:** [January 7, 2018, 2:50pm UTC](https://community.mp3tag.de/t/create-directory-if/19670/4 "2018-01-07T14:50:00Z")

</div>

> [@faisdlair](#):
>
> ok look what i have
> 
> DSD is ID3V2.3

drat!

Then we have to split the filename like:  
An action of the type "Format value" for \_Filename:  
Format string: X:\Shared Music$regexp(%\_filename\_ext%,._.(._),$1)\%\_filename%

The disadvantage of that solution is that you also get separate folders for MP4 files and all other types that manifest in the extension.

---

<div class="post-metadata">

**Author:** ![faisdlair](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/c4cdca/32.png) [@faisdlair](https://community.mp3tag.de/u/faisdlair)\
**Post date:** [January 7, 2018, 3:10pm UTC](https://community.mp3tag.de/t/create-directory-if/19670/5 "2018-01-07T15:10:32Z")

</div>

> [@ohrenkino](#):
>
> drat!
> 
> Then we have to split the filename like:  
> An action of the type "Format value" for \_Filename:  
> Format string: X:\Shared Music$regexp(%\_filename\_ext%,._.(._),$1)\%\_filename%
> 
> The disadvantage of that solution is that you also get separate folders for MP4 files and all other types that manifest in the extension.

Like you said , it creates many folders

dsf  
flac  
Heaven And Hell (DSD)  
Kodama  
mp3  
Paranoid (DSD)  
Wake Pig

No Artist folder, only albums and extensions

---

<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:** [January 7, 2018, 3:15pm UTC](https://community.mp3tag.de/t/create-directory-if/19670/6 "2018-01-07T15:15:07Z")

</div>

> [@faisdlair](#):
>
> ... action i'de like to set ...  
> If files are DSD then transfer them to"X:\Shared Music\DSD" ...

As user 'ohrenkino' already has worked out, ...  
do apply an action "Format value" on the pseudo tagfield \_FILENAME ...  
with the formatstring ...

$if($eql(%\_extension%,'DSD'),'X:\Shared Music\DSD\'%\_filename\_ext%,%\_path%)

You may create an action group to collect other filename extensions into one action, to move only dedicated files by one call of the action group, e. g. ...

$if($eql(%\_extension%,'DSD'),'X:\Shared Music\DSD\'%\_filename\_ext%,%\_path%)

$if($eql(%\_extension%,'DSF'),'X:\Shared Music\<!--fontc--\>DSF\<!--fontc--\>'%\_filename\_ext%,%\_path%)  
$if($eql(%\_extension%,'MP3'),'X:\Shared Music\<!--fontc--\>MP3\<!--fontc--\>'%\_filename\_ext%,%\_path%)  
$if($eql(%\_extension%,'FLAC'),'X:\Shared Music\<!--fontc--\>FLAC\<!--fontc--\>'%\_filename\_ext%,%\_path%)

 

... or just simplified for all file extensions ...  
Format value:

 \_FILENAME \<== 'X:\Shared Music\'$upper(%\_extension%)'\'%\_filename\_ext% 

DD.20180107.1715.CET, DD.20180107.1843.CET

---

<div class="post-metadata">

**Author:** ![faisdlair](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/c4cdca/32.png) [@faisdlair](https://community.mp3tag.de/u/faisdlair)\
**Post date:** [January 7, 2018, 3:40pm UTC](https://community.mp3tag.de/t/create-directory-if/19670/7 "2018-01-07T15:40:15Z")

</div>

> [@DetlevD](#):
>
> As user 'ohrenkino' already has worked out, ...  
> do apply an action "Format value" on the pseudo tagfield \_FILENAME ...  
> with the formatstring ...
> 
> $if($eql(%\_extension%,'DSF'),'X:\Shared Music\DSD\'%\_filename\_ext%,%\_path%)
> 
> You may create an action group to collect other filename extensions into one action, to move selected files all at once by one call of the action group, e. g.
> 
> $if($eql(%\_extension%,'DSF'),'X:\Shared Music\DSD\'%\_filename\_ext%,%\_path%)
> 
> $if($eql(%\_extension%,'MP3'),'X:\Shared Music\MP3'%\_filename\_ext%,%\_path%)  
> $if($eql(%\_extension%,'FLAC'),'X:\Shared Music\FLAC'%\_filename\_ext%,%\_path%)
> 
>  
> 
> DD.20180107.1715.CET

Same thing , it creates too many folders

DSD, FLAC MP3, and creates album folders.

DSD FLAC AND MP3 are empty and album folders contains songs

What i want to create is

X\Shared Music\DSD\Journey\Greatest Hits (DSD)\Track - title  
X\Shared Music\MP3\3\Wake Pig\Track - title  
X\Shared Music\FLAC\Alcest\Kodama\Track - title

Martin

---

<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:** [January 7, 2018, 3:55pm UTC](https://community.mp3tag.de/t/create-directory-if/19670/8 "2018-01-07T15:55:44Z")

</div>

> [@faisdlair](#):
>
> ...What i want to create is
> 
> X\Shared Music\DSD\Journey\Greatest Hits (DSD)\Track - title  
> X\Shared Music\MP3\3\Wake Pig\Track - title  
> X\Shared Music\FLAC\Alcest\Kodama\Track - title
> 
> Martin

OK, but you did not say so in the first post.  
I think we are all a little too complicated as the extension already exists - what about

Format value for %\_filename%  
Format string: X:\Shared Music\%\_extension%\%albumartist%$num(%track%,2) - %title%  
(I wonder where the album is gone ... and I wonder where the "3" for the MP3 folder comes from)

---

<div class="post-metadata">

**Author:** ![faisdlair](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/c4cdca/32.png) [@faisdlair](https://community.mp3tag.de/u/faisdlair)\
**Post date:** [January 7, 2018, 3:58pm UTC](https://community.mp3tag.de/t/create-directory-if/19670/9 "2018-01-07T15:58:57Z")

</div>

> [@ohrenkino](#):
>
> OK, but you did not say so in the first post.  
> I think we are all a little too complicated as the extension already exists - what about
> 
> Format value for %\_filename%  
> Format string: X:\Shared Music\%\_extension%\%albumartist%$num(%track%,2) - %title%  
> (I wonder where the album is gone ... and I wonder where the "3" for the MP3 folder comes from)

3 is the name of the band

[CJOINT](https://www.cjoint.com/c/HAhq6D3TtXj)

Kodama, Wake Pig and Greatest Hits are Album Folders

---

<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:** [January 7, 2018, 4:00pm UTC](https://community.mp3tag.de/t/create-directory-if/19670/10 "2018-01-07T16:00:38Z")

</div>

> [@faisdlair](#):
>
> 3 is the name of the band

Ah, ok.  
then I have to append my suggestion for a  
format string: X:\Shared Music\%\_extension%\%albumartist%\%album%$num(%track%,2) - %title%

---

<div class="post-metadata">

**Author:** ![faisdlair](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/c4cdca/32.png) [@faisdlair](https://community.mp3tag.de/u/faisdlair)\
**Post date:** [January 7, 2018, 4:04pm UTC](https://community.mp3tag.de/t/create-directory-if/19670/11 "2018-01-07T16:04:36Z")

</div>

> [@ohrenkino](#):
>
> Ah, ok.  
> then I have to append my suggestion for a  
> format string: X:\Shared Music\%\_extension%\%albumartist%\%album%$num(%track%,2) - %title%

PERFECT, but one more thing

It creates folder like

dsf  
mp3  
flac

Can they be like that (capitalize)

DSD (if not DSF)  
MP3  
FLAC

thank you

Martin

---

<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:** [January 7, 2018, 4:07pm UTC](https://community.mp3tag.de/t/create-directory-if/19670/12 "2018-01-07T16:07:55Z")

</div>

> [@faisdlair](#):
>
> PERFECT, but one more thing
> 
> It creates folder like  
> ...
> 
> DSD (if not DSF)  
> MP3  
> FLAC
> 
> thank you
> 
> Martin

format string: X:\Shared Music$upper(%\_extension%)\%albumartist%\%album%$num(%track%,2) - %title%

---

<div class="post-metadata">

**Author:** ![faisdlair](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/c4cdca/32.png) [@faisdlair](https://community.mp3tag.de/u/faisdlair)\
**Post date:** [January 7, 2018, 4:11pm UTC](https://community.mp3tag.de/t/create-directory-if/19670/13 "2018-01-07T16:11:15Z")

</div>

> [@ohrenkino](#):
>
> format string: X:\Shared Music$upper(%\_extension%)\%albumartist%\%album%$num(%track%,2) - %title%

Perfect

thank you again

Martin

---

<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:** [January 7, 2018, 4:19pm UTC](https://community.mp3tag.de/t/create-directory-if/19670/14 "2018-01-07T16:19:38Z")

</div>

> [@faisdlair](#):
>
> Same thing , it creates too many folders ...

The given actions can only do what they should do, which is to apply the programmatic given file extensions.  
It seems that you did something wrong.

DD.20180107.1819.CET

---

<div class="post-metadata">

**Author:** ![faisdlair](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/c4cdca/32.png) [@faisdlair](https://community.mp3tag.de/u/faisdlair)\
**Post date:** [January 7, 2018, 4:25pm UTC](https://community.mp3tag.de/t/create-directory-if/19670/15 "2018-01-07T16:25:00Z")

</div>

What ohrenkino writes in his last quote was perfect for me

It is working like i want now

Sorry

Martin

---

<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:27pm UTC](https://community.mp3tag.de/t/create-directory-if/19670/16 "2026-02-09T12:27:10Z")

</div>


