# Adding Track Number to Filename

**URL:** <https://community.mp3tag.de/t/adding-track-number-to-filename/11369>\
**Category:** Support\
**Created:** [December 31, 2010, 11:38am UTC](https://community.mp3tag.de/t/adding-track-number-to-filename/11369 "2010-12-31T11:38:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jatolo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/ea5d25/32.png) [@Jatolo](https://community.mp3tag.de/u/Jatolo)\
**Post date:** [December 31, 2010, 11:38am UTC](https://community.mp3tag.de/t/adding-track-number-to-filename/11369/1 "2010-12-31T11:38:36Z")

</div>

Good Morning and HAPPY NEW YEAR...  
I would like to add The tracking number to filename.  
How can it be done???  
Thanks

---

<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:** [December 31, 2010, 3:13pm UTC](https://community.mp3tag.de/t/adding-track-number-to-filename/11369/2 "2010-12-31T15:13:06Z")

</div>

Thanks.  
I hope that you have filled the usual tags like artist and title.  
Then, to rename files, use the converter "Tag - Filename" (menu convert) and enter a mask e.g. like this:

%track% - %artist% \_ %title%  
(this assumes that the tags for artist and title are not empty).  
If you want to get leading zeros for the track number then use a mask like this:  
$num(%track%,2) - %artist% \_ %title%

Have a look at the preview function that gives you an impression of the converted filename.  
Also please not the arrow button on the right in that dialog that opens a list of available tags to be added to the mask.  
have fun.

---

<div class="post-metadata">

**Author:** ![Joeger](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joeger](https://community.mp3tag.de/u/Joeger)\
**Post date:** [March 6, 2018, 2:05pm UTC](https://community.mp3tag.de/t/adding-track-number-to-filename/11369/3 "2018-03-06T14:05:45Z")

</div>

Hi, also just want to add number before the track having used this code with the tag to tag converter:  
%TRACK%  
$num(%track%,2) %title%

And the preview shows the correct coding but after pressing ok nothing has been changed. What is wrong there?

---

<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:** [March 6, 2018, 2:13pm UTC](https://community.mp3tag.de/t/adding-track-number-to-filename/11369/4 "2018-03-06T14:13:07Z")

</div>

> [@Joeger](#):
>
> tag to tag converter:
> 
> %TRACK%
> 
> $num(%track%,2) %title%

The function Convert\>Tag-Tag  
modifies the contents of a tag field or another property like \_FILENAME.  
You would have to choose the correct converter - I would choose Convert\>Tag-Filename is the best to rename files.

If you insist on Convert\>Tag-Tag then you would have to use \_FILENAME as field without the %. The syntax %track% for field is invalid.

---

<div class="post-metadata">

**Author:** ![Joeger](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joeger](https://community.mp3tag.de/u/Joeger)\
**Post date:** [March 6, 2018, 3:45pm UTC](https://community.mp3tag.de/t/adding-track-number-to-filename/11369/5 "2018-03-06T15:45:25Z")

</div>

Thanks, but Convert Tag--Filename does not work, because I want to keep the filename and the tagname. But before the filename should be a prefix with the track number like:  
OLD:  
track1  
track2  
track3  
and NEW renamed as  
01 track1  
02 track2  
03 track3

Thus I need the tag-tag function. But even replacing track and title with \_filename in my code above does not bring the result. Could you give me the exact code for the first and the 2nd field for the tag-tag converter, please. Thanks.

---

<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:** [March 6, 2018, 6:19pm UTC](https://community.mp3tag.de/t/adding-track-number-to-filename/11369/6 "2018-03-06T18:19:45Z")

</div>

If you insist on Convert\>Tag-Tag then still use as  
field: \_FILENAME  
Format string: $num(%track%,2) %\_filename%

---

<div class="post-metadata">

**Author:** ![Joeger](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joeger](https://community.mp3tag.de/u/Joeger)\
**Post date:** [March 7, 2018, 10:05am UTC](https://community.mp3tag.de/t/adding-track-number-to-filename/11369/7 "2018-03-07T10:05:00Z")

</div>

Perfect. Now it works. Thanks!

---

<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:** [June 19, 2023, 7:40am UTC](https://community.mp3tag.de/t/adding-track-number-to-filename/11369/8 "2023-06-19T07:40:12Z")

</div>

8 posts were split to a new topic: [Adding track number to TITLE](https://community.mp3tag.de/t/adding-track-number-to-title/61297)

---

<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:** [June 19, 2023, 7:40am UTC](https://community.mp3tag.de/t/adding-track-number-to-filename/11369/9 "2023-06-19T07:40:37Z")

</div>


