# \[SOLVED\] Auto-numbering total tracks on a per-folder basis

**URL:** https://community.mp3tag.de/t/solved-auto-numbering-total-tracks-on-a-per-folder-basis/19269
**Category:** Support
**Created:** [August 25, 2017, 10:05am UTC](https://community.mp3tag.de/t/solved-auto-numbering-total-tracks-on-a-per-folder-basis/19269 "2017-08-25T10:05:41Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![logon](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/e56c9b/32.png) [@logon](https://community.mp3tag.de/u/logon)
#### Post date: [August 25, 2017, 10:05am UTC](https://community.mp3tag.de/t/solved-auto-numbering-total-tracks-on-a-per-folder-basis/19269/1 "2017-08-25T10:05:41Z")

</div>

My first post here: hi all of you!

After a lot of search with no result I wonder if there is a way in order to write track number in x/x format using the total tracks Tag-Tag Convert function on a per-folder basis...

Running 2.79 version and using the following string:

$num(%TRACK%,1)/$num(%\_COUNTER%,1)

the program seems perfectly able to write track numbers and total tracks, but only for ALL files selected just as if they were in a single folder/album and then I do not know if there is a way to write total tracks number resetting total tracks autonumbering for each sub-folder.

Any addressing will be more than appreciated.

Many thanks in advance.

---

<div class="post-metadata">

### Author: ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)
#### Post date: [August 25, 2017, 10:10am UTC](https://community.mp3tag.de/t/solved-auto-numbering-total-tracks-on-a-per-folder-basis/19269/2 "2017-08-25T10:10:42Z")

</div>

Answered a few days ago.

[Actions question](https://community.mp3tag.de/t/19257/2)

---

<div class="post-metadata">

### Author: ![logon](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/e56c9b/32.png) [@logon](https://community.mp3tag.de/u/logon)
#### Post date: [August 25, 2017, 11:00am UTC](https://community.mp3tag.de/t/solved-auto-numbering-total-tracks-on-a-per-folder-basis/19269/3 "2017-08-25T11:00:29Z")

</div>

Thanks **stevehero** , but I'm not sure if there was a misunderstanding...

Currently I have a "Rock" folder containing a lot of sub-folders named as each Artist/Album title.  
All tags of all audio-files are already written.  
Now I want to set all Track numbers followed by Total Tracks number of each folder/album letting the existing track numbers and "simply" adding the folder/album related Total Tracks number.  
Running Mp3tag (2.79) and select "Rock" directory then ALL files existing in all sub-folders result as selected.  
Using "Convert \> Tag - Tag" function with the following string  
$num(%TRACK%,1)/$num(%\_COUNTER%,1)  
it does renumber ALL tracks in ascending order and then add a related Total Tracks number that does result as incorrect because it does consider all selected files like in a single folder.  
If I add each sub-directory individually then that way does work correctly, but I do not want to select individually over than 750 sub-folders.  
May be it is a mission impossible...

---

<div class="post-metadata">

### Author: ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)
#### Post date: [August 25, 2017, 11:10am UTC](https://community.mp3tag.de/t/solved-auto-numbering-total-tracks-on-a-per-folder-basis/19269/4 "2017-08-25T11:10:43Z")

</div>

> [@logon](#):
>
> of each folder/album

This can be done natively by CTRL+K or ![:mt_trackwiz:](https://community.mp3tag.de/uploads/default/original/1X/fcf97a0c706e2b7e25f47869511be942ac5d9e8c.png ":mt\_trackwiz:") with reset counter for each dir enabled.

It works on a per folder basis. Regardless of the hierarchy of the files.

Maybe I'm still picking up wrong.

---

<div class="post-metadata">

### Author: ![logon](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/e56c9b/32.png) [@logon](https://community.mp3tag.de/u/logon)
#### Post date: [August 25, 2017, 11:47am UTC](https://community.mp3tag.de/t/solved-auto-numbering-total-tracks-on-a-per-folder-basis/19269/5 "2017-08-25T11:47:12Z")

</div>

> [@stevehero](#):
>
> This can be done natively by CTRL+K or ![:mt_trackwiz:](https://community.mp3tag.de/uploads/default/original/1X/fcf97a0c706e2b7e25f47869511be942ac5d9e8c.png ":mt\_trackwiz:") with reset counter for each dir enabled.
> 
> It works on a per folder basis. Regardless of the hierarchy of the files.
> 
> Maybe I'm still picking up wrong.

Many thanks for your appreciated reply, but I thought that myself was wrong not even you!

Anyway, I already tried that way and results are just as in the attached screenshot (related to 2 folders/albums only just to show results): please, where am I wrong?

 ![](https://community.mp3tag.de/uploads/default/original/2X/4/480b008a8110209ab0650a19520959cade17e7b9.png)

---

<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: [August 25, 2017, 12:04pm UTC](https://community.mp3tag.de/t/solved-auto-numbering-total-tracks-on-a-per-folder-basis/19269/6 "2017-08-25T12:04:07Z")

</div>

You would have to sort the files by \_DIRECTORY so that all files from one folder come together as a group.  
So: first sort them by track, then by \_directory.

---

<div class="post-metadata">

### Author: ![logon](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/e56c9b/32.png) [@logon](https://community.mp3tag.de/u/logon)
#### Post date: [August 25, 2017, 12:09pm UTC](https://community.mp3tag.de/t/solved-auto-numbering-total-tracks-on-a-per-folder-basis/19269/7 "2017-08-25T12:09:00Z")

</div>

Yes, that way it does work: so many thanks, **ohrenkino**!

Thanks all of you.

---

<div class="post-metadata">

### Author: ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)
#### Post date: [August 25, 2017, 1:03pm UTC](https://community.mp3tag.de/t/solved-auto-numbering-total-tracks-on-a-per-folder-basis/19269/8 "2017-08-25T13:03:23Z")

</div>

You can change the default behaviour of how the columns sort by using something like **_ohrenkino_** mentioned only translated to the column setup.

Here's my sort entry for the album column for example. Takes into consideration formats as I may have mp3s or FLACs so they need them to be sorted in order too.

%album% %\_extension% %discnumber% %track% %\_directory%

So you could use something like:

%discnumber% %track% %\_directory%

This would be the same as clicking the **discnumber** column, then **track** then **\_directory**

Right mouse click on the column to edit this, see: **Sort by.**

---

<div class="post-metadata">

### Author: ![logon](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/e56c9b/32.png) [@logon](https://community.mp3tag.de/u/logon)
#### Post date: [August 25, 2017, 3:03pm UTC](https://community.mp3tag.de/t/solved-auto-numbering-total-tracks-on-a-per-folder-basis/19269/9 "2017-08-25T15:03:24Z")

</div>

Many thanks for your informative post!

In my specific case since the player in my car shows the disc number of FLAC files even if it is 1/1 I've removed disc number at all from tags "replacing" that with a custom file naming/tagging that does include the 2+ disc possible info and all album-folders are named by alphanumeric.

So it has been enough for me adding a "Path" column at the end of the line and clicking on it...

However, really a great program!

Thank you all

---

<div class="post-metadata">

### Author: ![logon](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/e56c9b/32.png) [@logon](https://community.mp3tag.de/u/logon)
#### Post date: [January 21, 2018, 10:44am UTC](https://community.mp3tag.de/t/solved-auto-numbering-total-tracks-on-a-per-folder-basis/19269/10 "2018-01-21T10:44:05Z")

</div>

Hi all!

Strange enough after about 5 months from the described (and solved) issue now it seems that I'm no longer able to convert TRACK tags to x/x format (on a per-folder basis, of course)...  
Using the usual string **$num(%TRACK%,1)/$num(%\_COUNTER%,1)** it writes the TOTAL track number ignoring the per-folder basis instruction (please look at the sshot in attachment): why?

Any suggestion more than welcome!

Mp3tag v2.85

 ![](https://community.mp3tag.de/uploads/default/original/2X/1/14b69a504d955de5965afb93cb877c0f681c5374.png)

---

<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 21, 2018, 11:38am UTC](https://community.mp3tag.de/t/solved-auto-numbering-total-tracks-on-a-per-folder-basis/19269/11 "2018-01-21T11:38:47Z")

</div>

None except the track numbering wizard knows anything about directory change.

So, %\_counter% counts all the selected files and does not reset at a folder boundary.  
You either select only files of one folder and apply the action or use the track numbering wizard.  
Also, I think that the variable to count the total number of files should not be %\_counter% but %\_total\_files%.

---

<div class="post-metadata">

### Author: ![logon](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/e56c9b/32.png) [@logon](https://community.mp3tag.de/u/logon)
#### Post date: [January 21, 2018, 4:28pm UTC](https://community.mp3tag.de/t/solved-auto-numbering-total-tracks-on-a-per-folder-basis/19269/12 "2018-01-21T16:28:35Z")

</div>

Yes, you're right **ohrenkino** and it does work great!  
Sorry, but after 5 months I did not well-remember the issue...  
Thank you so very much!!!

---

<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:26pm UTC](https://community.mp3tag.de/t/solved-auto-numbering-total-tracks-on-a-per-folder-basis/19269/13 "2026-02-09T12:26:58Z")

</div>


