Removing different styles of track numbering

hello lads,

I have filenames with different styles of track numbering like for eg: "01." & some files wud have "01-" & some others have "01_" . . . i wanna remove all 3 kinds of track numbering in a single go . ..
Can i set any action for this . ..

Right now i'm using "Replace" as action & replacing "01." & leaving the "Replace with" section empty. so tht removes the track number 01. But i have to do this for 02. also & so on.

But this is just one style of numbering .. for another style (01-) i have to make another set of actions and then also another set of actions for the third style (01_)

Basically thts creating a lotta actions ... but can i do it for all three styles (01. & 01- & 01_) all at the same time with single action or may be say 3 actions.

Create an action of the type "Replace with regular expression".
\d stands for any kind of number
\d+ stands for a sequence of numbers
the ^ represents the start of a field
. represents any kind of character
If you are sure that there are always 2 digits followed by any kind of character then use as search string:

^\d\d.
if you are unsure about the 2 digits use:
\d+.

Leave the replace string empty.

Problem might be that treating a filename like

  1. New song
    would lead to a leading blank. So perhaps you create an action group with 2 actions of the type "Replace with regular expression", the first with
    \d+.\s
    the second with
    \d+.

A regular expression like:
^\d+\s*[_|-|.]\s*

Will do all the 3 types of text string you mention.
^ start of string
\d+ a digit but a delimiter between 1 and infinity
\s* a whitespace character with delimiter between 0 and infinity
[_|-|.] match any of the characters you described above
\s* see above

That should do your trick. Make sure the ^ is at the start as it is very important.

@ ohrenkinoooooo ... u rock man . . thxn brov .. :slight_smile:
I have just one more doubt . . i'm searching for it .. if i dont get the answer, hope u can solve it again for me...

@ stevehero . .. thnx mate but i didnt tried ur one coz . ... 1. i didnt know how to use a regular expression without using an action . . i mean is there something like a coding page in Mp3tag where u write the regular expressions . . i have no clue bout tht .. &
2. i wanted to make an action for it.
But i really really appreciate u responding . . thxn a ton mate .. :slight_smile:

You can add an action with the replace with regular expression action. See FAQ for this and enter the following.

Field: FILENAME
Regexp: ^\d+\s*[
|-|.]\s*
Replace with: leave blank.

You don't necessarily need a complicated regular expression to pick the track number out of the filename and put it back. If the track numbers are correct within the TRACK field, then you only need to rewrite the filename.

Create an action group with two actions.

  1. First, clean up the TRACK number field, just to be sure it also doesn't contain anything like periods, dashes or leading zeroes.

Action type: Format value
Field: TRACK
Format string: $fmtNum(%track%)

  1. Then rewrite your filename. (Modify the format string to include artist, album name, or anything else you like.)

Action type: Format value
Field: _FILENAME
Format string: $num(%track%,2) %title%