# Remove leading numbers from filename

**URL:** https://community.mp3tag.de/t/remove-leading-numbers-from-filename/58420
**Category:** Mac
**Created:** [September 4, 2022, 11:45pm UTC](https://community.mp3tag.de/t/remove-leading-numbers-from-filename/58420 "2022-09-04T23:45:15Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![JimAustin](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/d6d6ee/32.png) [@JimAustin](https://community.mp3tag.de/u/JimAustin)
#### Post date: [September 4, 2022, 11:45pm UTC](https://community.mp3tag.de/t/remove-leading-numbers-from-filename/58420/1 "2022-09-04T23:45:15Z")

</div>

Possibly my first post here, although I may have posted 6-ish years ago when I was ripping my whole CD library. At that time I was using mp3tag for Windows on a Mac using whatever procedure was in place then that made that work. I don't remember the details, but I had a good experience. Returning to it now, I find I've forgotten much of the little I learned.

So, first question: In mp3tag for Mac, it seems that the Filename - Filename option is missing from the Convert menu--yes? Why is that?

I'm trying to do something simple that I know is well within mp3tag's capabilities; I just can't remember (or just don't know) how. I'm working with pre-release music downloads; little effort is made to make the filenames user-friendly. One common thing is to include the disc and track number separated by an underscore, often after a numeric code. Stripping the numeric code is simple enough because it's the same for every track (every file). which leaves, eg, "01\_09\_Debussy Suite ..." I have already extracted the disc and track numbers; I'd just like to get rid of (eg) "01\_09\_" from the filename before rebuilding the filename (as, eg, DiscNo-Track name." So that's all really: Considering that it's different for every track, how do I, in a simple way, delete the first 6 characters from every fname? (I am not experienced using scripts, but I'm capable of it--just please provide practical details.)

Thanks,  
Jim

---

<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: [September 5, 2022, 5:48am UTC](https://community.mp3tag.de/t/remove-leading-numbers-from-filename/58420/2 "2022-09-05T05:48:24Z")

</div>

> [@JimAustin](#):
>
> I'd just like to get rid of (eg) "01\_09\_" from the filename before rebuilding the filename

See the FAQs on how to strip leading numbers:

> [@Regular Expressions](https://community.mp3tag.de/t/regular-expressions/521/3):
>
> Regular expression: ^\s\*[0-9]+\s\*-\s\* Replace with: This one will remove the track-number (if followed by a dash) and white space at the beginning of a string (for instance 01 - Come Together will become Come Together) Regular expression: ^\s\*[0-9]+\s+ Replace with: This one will remove the track-number if followed by a white space (for instance 01 Come Together will become Come Together)

I don't understand, though, why you first want to modify the filename

> [@JimAustin](#):
>
> before rebuilding the filename

If your rebuild the filename, then the numbers will be gone anyway, I would think. Goiing straight for the refurbishing would save 1 step.

More information about MP3tag for Mac functions can be found in the documentation:

> **[Documentation](https://community.mp3tag.de/c/mac/doc/34)**
>
> Learn all about the features of Mp3tag for Mac.

---

<div class="post-metadata">

### Author: ![JimAustin](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/d6d6ee/32.png) [@JimAustin](https://community.mp3tag.de/u/JimAustin)
#### Post date: [September 5, 2022, 1:50pm UTC](https://community.mp3tag.de/t/remove-leading-numbers-from-filename/58420/3 "2022-09-05T13:50:06Z")

</div>

First, apologies for missing this in the FAQ. I did check, but I must have been impatient, not knowing where to look. I'm thinking that what you've quoted from "Regular Expressions" is just what I need.

Why rebuild the filename? Because currently it starts with (eg) 01\_09\_Debussy ... , and I want to get rid of the junk at the beginning before I do discnumber-track number filename, so that it doesn't read

01-09 01\_09\_Debussy ... .

Which should be easy now that I know how to use Regular Expressions.

Any idea why Convert filaneme - filename is missing in the Mac version?

Thanks,  
Jim

---

<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: [September 5, 2022, 1:57pm UTC](https://community.mp3tag.de/t/remove-leading-numbers-from-filename/58420/4 "2022-09-05T13:57:21Z")

</div>

> [@JimAustin](#):
>
> 01-09 01\_09\_Debussy ...

What do your embedded tag fields look like?  
Wouldn't it be much easier to use Convert\>Tag-Filename and write a completely new filename?  
Also, if you want to get from  
01\_09\_  
to  
01-09  
then try:  
`$regexp(%_filename%,_(\d+)_,-$1 )`  
In Convert \>Tag-Tag for \_FILENAME

---

<div class="post-metadata">

### Author: ![JimAustin](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/d6d6ee/32.png) [@JimAustin](https://community.mp3tag.de/u/JimAustin)
#### Post date: [September 5, 2022, 2:14pm UTC](https://community.mp3tag.de/t/remove-leading-numbers-from-filename/58420/5 "2022-09-05T14:14:30Z")

</div>

> [@ohrenkino](#):
>
> What do your embedded tag fields look like?

Boy do I feel dumb. I had not bothered to look; I just assumed that the "title" tag was identical to the filename. Inexperience I guess. In fact, the title" tag does NOT have those first six characters, and I'm not sure why. (When I received the file, none of the tag fields were populated.) Is that something I did and forgot about, or is mp3tag just smart that way?

Anyway, that means I've been trying to solve a problem that doesn't exist. I just need to rebuild the filename, which is easy even for me.

Thanks,  
Jim
