# Adding number of disc information from and to filename

**URL:** https://community.mp3tag.de/t/adding-number-of-disc-information-from-and-to-filename/5075
**Category:** Support
**Created:** [June 27, 2007, 3:15am UTC](https://community.mp3tag.de/t/adding-number-of-disc-information-from-and-to-filename/5075 "2007-06-27T03:15:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![poldim](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/aca169/32.png) [@poldim](https://community.mp3tag.de/u/poldim)
#### Post date: [June 27, 2007, 3:15am UTC](https://community.mp3tag.de/t/adding-number-of-disc-information-from-and-to-filename/5075/1 "2007-06-27T03:15:28Z")

</div>

First, I just want to thank everyone who has worked on MP3TAG since its amazing.

The ordeal:  
Most of the music I get is multiple disc compilations. Generally, either the file name has 3 number in the beginning of the file name to identify this (###). I figured out I can use the filter to test some RegEx and got _[1-9][0-9][0-9]_ working on finding these tracks.  
The bad stuff is when the filename only has two number but still part of a multi disc set. In this case there is usually one of the following strings in the %album% field: "Disc #", "CD #", "Volume #", "Vol. #", or "Vol #". These can also vary with either having (or not having) spaces and underscores.

What I want to do is create an action / script that would first check for the 3 numbers in the filename. If not found, it would check for the string's in the %album% field. If it does find 3 numbers, it would have to export the first digit to a %disc% field that I have to store the disc number. If it goes the string route, it would have to export that appropriate digit to the %disc% field.

The entire process should leave the file exactly as it was unless the file is part of a multi disc set where it would add the disc number information.

I'm going to fool around and see what I can get figured out, but unfortunately I've never used RegEx before.

TIA

---

<div class="post-metadata">

### Author: ![poldim](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/aca169/32.png) [@poldim](https://community.mp3tag.de/u/poldim)
#### Post date: [July 18, 2007, 10:08pm UTC](https://community.mp3tag.de/t/adding-number-of-disc-information-from-and-to-filename/5075/2 "2007-07-18T22:08:16Z")

</div>

've been using this regular expression replacement:

```
Field: Album
Replace: (.*.)(\(?(Disc|CD)\s?[0-9]\s?\)?\s?)(.*.)?
Replace with: $1\(Disc

```

It seems to be working fine.

I thought of a nice couple of features for mp3tag while doing this though...to be posted in another thread

---

<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:20pm UTC](https://community.mp3tag.de/t/adding-number-of-disc-information-from-and-to-filename/5075/3 "2026-02-09T12:20:22Z")

</div>


