# how to add leading digits of your choice

**URL:** https://community.mp3tag.de/t/how-to-add-leading-digits-of-your-choice/8076
**Category:** Support
**Created:** [March 12, 2009, 12:48am UTC](https://community.mp3tag.de/t/how-to-add-leading-digits-of-your-choice/8076 "2009-03-12T00:48:49Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![evergreen1](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/a9adbd/32.png) [@evergreen1](https://community.mp3tag.de/u/evergreen1)
#### Post date: [March 12, 2009, 12:48am UTC](https://community.mp3tag.de/t/how-to-add-leading-digits-of-your-choice/8076/1 "2009-03-12T00:48:49Z")

</div>

i have filenames like these:-

mysong.mp3  
yoursong.mp3  
hissong.mp3  
hersong.mp3

kidly instruct me what to do if i want these to appear filename like these:-( two leading digits and a space before the filename text)

21 mysong.mp3  
22 yoursong.mp3  
23 hissong.mp3  
24 hersong.mp3

kindly instruct me what to do if i want these to appear filename like these:-( three leading digits and a space before the filename text)

243 mysong.mp3  
244 yoursong.mp3  
245 hissong.mp3  
246 hersong.mp3

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [March 12, 2009, 2:21pm UTC](https://community.mp3tag.de/t/how-to-add-leading-digits-of-your-choice/8076/2 "2009-03-12T14:21:52Z")

</div>

Convert \> Filename - tag:

_$num($add(%\_counter%,20),2) %\_filename%_

---

<div class="post-metadata">

### Author: ![evergreen1](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/a9adbd/32.png) [@evergreen1](https://community.mp3tag.de/u/evergreen1)
#### Post date: [March 12, 2009, 8:58pm UTC](https://community.mp3tag.de/t/how-to-add-leading-digits-of-your-choice/8076/3 "2009-03-12T20:58:51Z")

</div>

i found a way out. i have no words to express my gratitude towards the developers of this software. this soft is so nice. for the information of concerned i would like to quote the format string.

original filenames:-

mysong(album name)@abc.com  
hissong(album name)@abc.com  
hersong(album name)@abc.com)

original title:-

mysong.mp3  
hissong.mp3  
hersong.mp3

action\>convert\>tag-filename.  
format string:$num(+2%\_counter%,)-%title%  
now you get filenames as:-  
21-mysong.mp3  
22-hissong.mp3  
23-hersong.mp3  
if you want to get filenames starting from 101-  
format string:$num(+10%\_counter%,)-%title%  
and thus you can have your files renamed with any digits of your wish using this format string.

anyway thanks for dano who has responded so quickly.have a nice day.

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [March 13, 2009, 1:03pm UTC](https://community.mp3tag.de/t/how-to-add-leading-digits-of-your-choice/8076/4 "2009-03-13T13:03:57Z")

</div>

Sorry but your strings are bad examples which nobody should imitate.

$num(+2%\_counter%,)-%title%  
Why is there a+ sign? It has no use. And there is no 2nd parameter in the $num function. It seems to be the same as $num(x,1) but you should still write the 2nd value.

$num(+10%\_counter%,)-%title%  
better:  
**1$num(%\_counter%,2)-%title%**

Your first problem is unclear:

_format string:$num(+2%\_counter%,)-%title%_

now you get filenames as:-  
21-mysong.mp3  
22-hissong.mp3  
23-hersong.mp3  
...  
210-hersong.mp3  
211-hersong.mp3

What's the logic behind that?

---

<div class="post-metadata">

### Author: ![evergreen1](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/a9adbd/32.png) [@evergreen1](https://community.mp3tag.de/u/evergreen1)
#### Post date: [March 14, 2009, 8:28pm UTC](https://community.mp3tag.de/t/how-to-add-leading-digits-of-your-choice/8076/5 "2009-03-14T20:28:35Z")

</div>

that if i want two digits before the filename, then the first string if i want three digits before the filename then next string.

i am happy that you have responded so quickly and thanks you Dano. I claim no authority, ia m a novice in this field. i just quoted the string in the hope that somebody may benefit from it.

kinldy help me in finding out solution for the following problem.  
with the above string i can get filenames with digits starting from 01.02.03. or 11,12,13 or 21,22,23 or 101,102,103 etc. if i want a group of filenames to get the filenames starting from digits 27 what to do? then if it should start from 167 what to do?what i mean is i should get the above filenames as  
27-mysong.mp3  
28-hissong.mp3  
29-hersong.mp3

167-mysong.mp3  
168-hissong.mp3  
169-hersong.mp3

thanks in advance. have a nice day.

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [March 16, 2009, 9:42pm UTC](https://community.mp3tag.de/t/how-to-add-leading-digits-of-your-choice/8076/6 "2009-03-16T21:42:36Z")

</div>

See my first answer:  
$add(%\_counter%,20)

with the $add() function you can define the start value

---

<div class="post-metadata">

### Author: ![evergreen1](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/a9adbd/32.png) [@evergreen1](https://community.mp3tag.de/u/evergreen1)
#### Post date: [March 17, 2009, 3:38am UTC](https://community.mp3tag.de/t/how-to-add-leading-digits-of-your-choice/8076/7 "2009-03-17T03:38:07Z")

</div>

your suggestion doesn't give the expected result.it gives only the same number to all the files.  
$add(%\_counter%,20) gives 21 as leading digits for all the files selected for formatting. in my case all the three examples will have leading digits of 21. i want it to be in the arithmatic progression. that also should start with other digits than 1. example i should expect to get 26 for the first file 27 for the second and 28 for the third.

if i give $add(%\_counter%,25)  
it will give 251 as leading digits,that also to all the files

can i ask you some more help?

thanks in advance.

---

<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: [March 17, 2009, 4:42am UTC](https://community.mp3tag.de/t/how-to-add-leading-digits-of-your-choice/8076/8 "2009-03-17T04:42:31Z")

</div>

> [@evergreen1](#):
>
> your suggestion doesn't give the expected result.it gives only the same number to all the files. ...

I cannot see why **$add(%\_counter%,25)** should not work as expected, see following example preview output from a Tag-Filename action:

```
"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\01_Warning_LaurentGarnier_UB_2000.mp3" ->
"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\26.mp3"

"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\02_CityShpere_LaurentGarnier_UB_2000.mp3" ->
"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\27.mp3"

"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\03_ForgottenThoughts_LaurentGarnier_UB_2000.mp3" ->
"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\28.mp3"

"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\04_SoundOfTheBigBabou_LaurentGarnier_UB_2000.mp3" ->
"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\29.mp3"

"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\05_UnreasonableBehaviour_LaurentGarnier_UB_2000.mp3" ->
"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\30.mp3"

"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\06_CyclesDoppositions_LaurentGarnier_UB_2000.mp3" ->
"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\31.mp3"

"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\07_ManWithTheRedFace_LaurentGarnier_UB_2000.mp3" ->
"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\32.mp3"

"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\08_CommunicationsFromTheLab_LaurentGarnier_UB_2000.mp3" ->
"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\33.mp3"

"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\09_Greed_LaurentGarnier_UB_2000.mp3" ->
"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\34.mp3"

"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\10_DangerousDrive_LaurentGarnier_UB_2000.mp3" ->
"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\35.mp3"

"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\11_Downfall_LaurentGarnier_UB_2000.mp3" ->
"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\36.mp3"

"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\12_LastTributeFromThe20thCentury_LaurentGarnier_UB_2000.mp3" ->
"O:\MUSIK\ROCK\L\Laurent Garnier\Unreasonable Behaviour\37.mp3"

```

DD.20090317.0642.CET

---

<div class="post-metadata">

### Author: ![evergreen1](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/a9adbd/32.png) [@evergreen1](https://community.mp3tag.de/u/evergreen1)
#### Post date: [March 18, 2009, 7:42pm UTC](https://community.mp3tag.de/t/how-to-add-leading-digits-of-your-choice/8076/9 "2009-03-18T19:42:13Z")

</div>

thanks a lot ,dano. it works.  
have a nice day.

---

<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:21pm UTC](https://community.mp3tag.de/t/how-to-add-leading-digits-of-your-choice/8076/10 "2026-02-09T12:21:25Z")

</div>


