# exluding extension when renaming removing numbers

**URL:** https://community.mp3tag.de/t/exluding-extension-when-renaming-removing-numbers/6055
**Category:** Support
**Created:** [January 13, 2008, 12:00am UTC](https://community.mp3tag.de/t/exluding-extension-when-renaming-removing-numbers/6055 "2008-01-13T00:00:45Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Rusherman](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/b38774/32.png) [@Rusherman](https://community.mp3tag.de/u/Rusherman)
#### Post date: [January 13, 2008, 12:00am UTC](https://community.mp3tag.de/t/exluding-extension-when-renaming-removing-numbers/6055/1 "2008-01-13T00:00:45Z")

</div>

Hi I just got this program today and already have it surpassing the programs I was using. My last and only problem is I want it to hunt down and delete all numbers 0-9. When I try doing this with replace My extension MP3 becomes Mp. There has to be a simple way to exclude the extension from these replacements but I haven't found it. Could someone help me on this. I am trying to get rid of dates and times ect. throughout about 36000 mp3 files. I will not try do do them all at once but only in small groups

---

<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: [January 13, 2008, 9:30am UTC](https://community.mp3tag.de/t/exluding-extension-when-renaming-removing-numbers/6055/2 "2008-01-13T09:30:16Z")

</div>

> [@Rusherman](#):
>
> ... My last and only problem is I want it to hunt down and delete all numbers 0-9. When I try doing this with replace My extension MP3 becomes Mp. ...

So what did you do to delete all numbers 0-9?

DD.20080113.1130.CET

---

<div class="post-metadata">

### Author: ![Rusherman](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/b38774/32.png) [@Rusherman](https://community.mp3tag.de/u/Rusherman)
#### Post date: [January 13, 2008, 1:44pm UTC](https://community.mp3tag.de/t/exluding-extension-when-renaming-removing-numbers/6055/3 "2008-01-13T13:44:08Z")

</div>

> [@DetlevD](#):
>
> So what did you do to delete all numbers 0-9?
> 
> DD.20080113.1130.CET

I did a replace on each number, replacing it with nothing ""

Replace With Regular Expression  
Field : Filename  
Original : 3  
Replace With : ""

It got rid of all the numbers. It just affects my extension as well. The numbers are not in one place where I can do a count to get them, or in one format that I could plan for. I just want to get rid of any number in the file name while leaving the extension alone.

---

<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: [January 13, 2008, 3:46pm UTC](https://community.mp3tag.de/t/exluding-extension-when-renaming-removing-numbers/6055/4 "2008-01-13T15:46:56Z")

</div>

> [@Rusherman](#):
>
> I did a replace on each number, replacing it with nothing ""
> 
> Replace With Regular Expression  
> Field : Filename  
> Original : 3  
> Replace With : ""
> 
> It got rid of all the numbers. It just affects my extension as well. The numbers are not in one place where I can do a count to get them, or in one format that I could plan for. I just want to get rid of any number in the file name while leaving the extension alone.

I think it is no good idea to delete all numbers, because you will corrupt those names like 'B52' or '2 Pac' and so on.

I suggest to filter your mp3 file base at first to get a pure list of filenames which contain digits.  
See how the digits are grouped together, are they date formatted, or running count numbers or what?  
Try to filter on similar formatted digit 'objects' e. g. numbers which represents a date object.  
As you are familiar with Regular Expressions you may use something like this to remove a date object from the filename string:  
$regexp(%\_filename%,(._?)(\d\d\d\d-\d\d-\d\d)(._?),$1$3)

If you really want to remove all digits from the %\_filename% variable you should do something to save the filename extension prior to the replacement and restore it afterwards.  
You may replace '.mp3' with '.###' and afterwards replace '.###' with '.mp3'.

An Actiongroup may look like the following:  
Begin Actiongroup **TEST Rusherman**

Action #1  
_Actiontype 2:_ **Replace**  
_Field:_ **\_FILENAME**  
_Original:_ **.mp3**  
_Replace with:_ **.###**

[\_] only as whole word[\_] case sensitive comparison

Action #2  
_Actiontype 5:_ **Format tag field**  
_Field:_ **\_FILENAME**  
_Formatstring:_ **$replace(%\_filename%,0,,1,,2,,3,,4,,5,,6,,7,,8,,9,)**

Action #3  
_Actiontype 2:_ **Replace**  
_Field:_ **\_FILENAME**  
_Original:_ **.###**  
_Replace with:_ **.mp3**

[\_] only as whole word[\_] case sensitive comparison

End Actiongroup **TEST Rusherman** (3 Actions)

DD.20080113.1745.CET

---

<div class="post-metadata">

### Author: ![Rusherman](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/b38774/32.png) [@Rusherman](https://community.mp3tag.de/u/Rusherman)
#### Post date: [January 13, 2008, 9:46pm UTC](https://community.mp3tag.de/t/exluding-extension-when-renaming-removing-numbers/6055/5 "2008-01-13T21:46:27Z")

</div>

Action #3  
Actiontype 2: Replace  
Field: _FILENAME  
Original: .###  
Replace with: .mp3  
[_] only as whole word  
[\_] case sensitive comparison

It does not exclude the filename and I will have to change it if I want to format other types of files, but it does work and I am going to use it for the job at hand. This saves me running the same files through several programs. Thank you for your help. The program itself is great and is only handicapped by my sparse math skills. It would be nice though to have Filename and Extension as separate action choices.

---

<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: [January 13, 2008, 11:26pm UTC](https://community.mp3tag.de/t/exluding-extension-when-renaming-removing-numbers/6055/6 "2008-01-13T23:26:56Z")

</div>

> [@](#):
>
> Action #2  
> Actiontype 5: Format tag field  
> Field: \_FILENAME  
> Formatstring: $replace(%\_filename%,0,,1,,2,,3,,4,,5,,6,,7,,8,,9,)

This action on its own solves the problem, \_FILENAME on Format value is without extension. Also works for all audio files.  
To make it really short use  
Formatstring: $regexp(%\_filename%,\d,)

---

<div class="post-metadata">

### Author: ![Rusherman](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/b38774/32.png) [@Rusherman](https://community.mp3tag.de/u/Rusherman)
#### Post date: [January 13, 2008, 11:45pm UTC](https://community.mp3tag.de/t/exluding-extension-when-renaming-removing-numbers/6055/7 "2008-01-13T23:45:17Z")

</div>

> [@dano](#):
>
> This action on its own solves the problem, \_FILENAME on Format value is without extension. Also works for all audio files.  
> To make it really short use  
> Formatstring: $regexp(%\_filename%,\d,)

Thank you Dano, This works a treat. I tried it with MP2, MP3 and MP4 and it works great. It does not interfere with any of my other formating so I am ready to start renaming and checking again on Monday.

---

<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/exluding-extension-when-renaming-removing-numbers/6055/8 "2026-02-09T12:20:42Z")

</div>


