exluding extension when renaming removing numbers


#1

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


#2

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

DD.20080113.1130.CET


#3

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.


#4

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


#5

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.


#6

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,)


#7

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.