# Help regarding export filename, please.

**URL:** https://community.mp3tag.de/t/help-regarding-export-filename-please/18383
**Category:** Export
**Created:** [October 30, 2016, 8:20am UTC](https://community.mp3tag.de/t/help-regarding-export-filename-please/18383 "2016-10-30T08:20:07Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![vvikkass](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/d26b3c/32.png) [@vvikkass](https://community.mp3tag.de/u/vvikkass)
#### Post date: [October 30, 2016, 8:20am UTC](https://community.mp3tag.de/t/help-regarding-export-filename-please/18383/1 "2016-10-30T08:20:07Z")

</div>

So I generally export NFOs. The problem is I dont know how to figure out the 00s in front of NFO file so that it remains on top among audiofils that starts with 01, 02 etc.

Scenario is I have 3 types of file names. Audio files starting from 1, 01 and 001. I want NFO to be numbered as 0, 00 and 000 respectively according to the audiofiles in directory.

Please help so that I can put everything in one code. Currently I use this:

```
%_folderpath%\$lower($replace(00-$cutLeft(%_filename%,3))).nfo

```

But it obviously cuts first alphabet when file name starts from 1.

Or any other alternative in export to get the filenames starting as 0, 00 and 000 according to the situation.

So I seek help regarding export file name.

---

<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: [October 30, 2016, 11:57am UTC](https://community.mp3tag.de/t/help-regarding-export-filename-please/18383/2 "2016-10-30T11:57:28Z")

</div>

... what about  
%\_folderpath%\00-$cutLeft(%\_filename%,3).nfo

---

<div class="post-metadata">

### Author: ![vvikkass](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/d26b3c/32.png) [@vvikkass](https://community.mp3tag.de/u/vvikkass)
#### Post date: [October 30, 2016, 12:17pm UTC](https://community.mp3tag.de/t/help-regarding-export-filename-please/18383/3 "2016-10-30T12:17:26Z")

</div>

because I want the nfo filename to be same like audio file name. Audio file names are all same, only differs the number of track.

---

<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: [October 30, 2016, 12:28pm UTC](https://community.mp3tag.de/t/help-regarding-export-filename-please/18383/4 "2016-10-30T12:28:00Z")

</div>

> [@vvikkass](#):
>
> because I want the nfo filename to be same like audio file name. Audio file names are all same, only differs the number of track.

Then I don't understand the organization of the files and how many nfo-files should be there in the end.  
Please give a concrete example of 2 audio file names with different track numbers and the corresponding nfo-filenames.

---

<div class="post-metadata">

### Author: ![vvikkass](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/d26b3c/32.png) [@vvikkass](https://community.mp3tag.de/u/vvikkass)
#### Post date: [October 30, 2016, 1:02pm UTC](https://community.mp3tag.de/t/help-regarding-export-filename-please/18383/5 "2016-10-30T13:02:11Z")

</div>

Ok, when I run my export tags for NFO it give me this result. ![:rolleyes:](https://community.mp3tag.de/uploads/default/original/1X/3a79e8b0b7d169b30216785521d7c6f4f895c421.gif ":rolleyes:")

**Example One:**  
Filenames:  
1-human\_heart\_cosmic\_heart.mp3  
2-human\_heart\_cosmic\_heart.mp3  
3-human\_heart\_cosmic\_heart.mp3  
4-human\_heart\_cosmic\_heart.mp3

NFO Filename becomes this:  
00-uman\_heart\_cosmic\_heart.nfo

I want NFO filename to become:  
0-human\_heart\_cosmic\_heart.nfo

**Example Two:**  
01-human\_heart\_cosmic\_heart.mp3  
02-human\_heart\_cosmic\_heart.mp3  
03-human\_heart\_cosmic\_heart.mp3  
04-human\_heart\_cosmic\_heart.mp3

NFO Filename become this (which is perfect):  
00-human\_heart\_cosmic\_heart.nfo

**Example Three:**  
001-human\_heart\_cosmic\_heart.mp3  
002-human\_heart\_cosmic\_heart.mp3  
003-human\_heart\_cosmic\_heart.mp3  
004-human\_heart\_cosmic\_heart.mp3

I want NFO filename to become:  
000-human\_heart\_cosmic\_heart.nfo

And want to make only one NFO file per directory.

---

<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: [October 30, 2016, 1:09pm UTC](https://community.mp3tag.de/t/help-regarding-export-filename-please/18383/6 "2016-10-30T13:09:51Z")

</div>

So perhaps this does it:  
%\_folderpath%$regexp(%\_filename%,\d+-(.\*),00-$1).nfo

---

<div class="post-metadata">

### Author: ![vvikkass](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/d26b3c/32.png) [@vvikkass](https://community.mp3tag.de/u/vvikkass)
#### Post date: [October 30, 2016, 1:50pm UTC](https://community.mp3tag.de/t/help-regarding-export-filename-please/18383/7 "2016-10-30T13:50:16Z")

</div>

Thanks, gonna try it now. Will reply back. 🙂

---

<div class="post-metadata">

### Author: ![vvikkass](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/d26b3c/32.png) [@vvikkass](https://community.mp3tag.de/u/vvikkass)
#### Post date: [October 30, 2016, 2:04pm UTC](https://community.mp3tag.de/t/help-regarding-export-filename-please/18383/8 "2016-10-30T14:04:07Z")

</div>

> [@vvikkass](#):
>
> Thanks, gonna try it now. Will reply back. 🙂

Thanks for your time again. But its giving nfo file that starts with 00 in all the cases.

I want nfo file to start with:  
0 when only 9 songs in the directory i.e. 1-9 tracks (single digit)  
00 when upto 99 songs in the directory i.e. 01-99 tracks (double digit)  
000 when upto 999 songs in the directory i.e. 001-999 tracks (triple digit)

---

<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: [October 30, 2016, 3:00pm UTC](https://community.mp3tag.de/t/help-regarding-export-filename-please/18383/9 "2016-10-30T15:00:54Z")

</div>

> [@vvikkass](#):
>
> Thanks for your time again. But its giving nfo file that starts with 00 in all the cases.
> 
> I want nfo file to start with:  
> 0 when only 9 songs in the directory i.e. 1-9 tracks (single digit)  
> 00 when upto 99 songs in the directory i.e. 01-99 tracks (double digit)  
> 000 when upto 999 songs in the directory i.e. 001-999 tracks (triple digit)

Sorry - I for some reason I thougt it was alsways 2 digits and sometimes 3.  
So here we go for the next attempt:

%\_folderpath%$num(0,$sub($strstr(%\_filename%,'-'),1))-$regexp(%\_filename%,\d+-(.\*),$1)

---

<div class="post-metadata">

### Author: ![vvikkass](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/d26b3c/32.png) [@vvikkass](https://community.mp3tag.de/u/vvikkass)
#### Post date: [October 30, 2016, 3:17pm UTC](https://community.mp3tag.de/t/help-regarding-export-filename-please/18383/10 "2016-10-30T15:17:09Z")

</div>

> [@ohrenkino](#):
>
> Sorry - I for some reason I thougt it was alsways 2 digits and sometimes 3.  
> So here we go for the next attempt:
> 
> %\_folderpath%$num(0,$sub($strstr(%\_filename%,'-'),1))-$regexp(%\_filename%,\d+-(.\*),$1)

Worked. Awesome. Thanks a lot. Solved.
