# Discnumber padding and export

**URL:** https://community.mp3tag.de/t/discnumber-padding-and-export/13867
**Category:** Support
**Created:** [September 12, 2012, 3:45pm UTC](https://community.mp3tag.de/t/discnumber-padding-and-export/13867 "2012-09-12T15:45:12Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![richmail](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/b2d939/32.png) [@richmail](https://community.mp3tag.de/u/richmail)
#### Post date: [September 12, 2012, 3:45pm UTC](https://community.mp3tag.de/t/discnumber-padding-and-export/13867/1 "2012-09-12T15:45:12Z")

</div>

Hi ,

I am using this script

Begin Actionsgroup Set DISCNUMBER n.3  
Action #1  
Actiontype 5: Format tag field  
Field: DISCNUMBER  
Formatstring: $regexp(%\_directory%,^._÷_CD÷_0_(\d+).\*$,$1)/42  
Note: Replace one special character ÷ with one space character.  
End Actionsgroup Set DISCNUMBER n.42 (1 Action)

[/t/10395/1](https://community.mp3tag.de/t/10395/1)

in my discnumber field i have 10/42 to 42/42 which are fine. However how can i pad out 1/42 to 9/42 so that they read 01/42 to 09/42?

When i export file files and rename folder the discnumber appears without the / so that 1/42 is 142 and 42/42 is 4242. Is there any way show a hypen "-" as a separator?  
%albumartist% - [%year% -]%album% (%discnumber%) '['%\_total% $upper(%\_extension%)$if($eql(%\_extension%,'flac'),, %\_bitrate%)$if($grtr(%\_covers%,0),, No Cover) %genre%']'

Thanks

Rich

---

<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: [September 13, 2012, 2:25am UTC](https://community.mp3tag.de/t/discnumber-padding-and-export/13867/2 "2012-09-13T02:25:32Z")

</div>

1. $regexp(%discnumber%,^(\d)/,0$1/)

2. $replace(%discnumber%,/,-)

---

<div class="post-metadata">

### Author: ![richmail](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/b2d939/32.png) [@richmail](https://community.mp3tag.de/u/richmail)
#### Post date: [September 16, 2012, 3:42am UTC](https://community.mp3tag.de/t/discnumber-padding-and-export/13867/3 "2012-09-16T03:42:08Z")

</div>

Thank you

---

<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:24pm UTC](https://community.mp3tag.de/t/discnumber-padding-and-export/13867/4 "2026-02-09T12:24:03Z")

</div>


