How to remove track from filename?

I have a bunch of songs that begin with 01 & 02. (note the .) track numbers at the beginning of each songs filename. Is there an easy way of removing this?


(Example songs)
09. Pink Floyd - Have a Cigar
11 - Donovan - Sunshine Superman (how can I remove the first hyphen but leave the second?)

ad 1: Do you want to have the dot replaced with a space character?
ad 2: Do you want to have the first hyphen replaced with nothing and should there remain two spaces between the track number and the artist?


Assuming the track number, artist, and title fields are correct, you could just rename the file from those fields:

Action type: Format value
Format string: $num(%track%,2) $validate(%artist% - %title%,-)

If not, a regex should work:

Action type: Format value
Format string: $regexp(%_filename%,^([0-9]+)\s*[.-]\s(.*) ,$1 $2)

I want the the track number, period and the first hyphen removed from the filename

This expression removes leading numbers, dots, hyphens and also space characters from the filename.

$regexp(%_FILENAME%,'^[\d.- ]+(.*)',$1)

Use it with "[Alt-1] Tag-Filename" or with an action "Format value".


I tried this action script only to get this (picture of error message)

Thank you works perfectly

That's easily done, but are you sure that you want the track number removed from the filename? That generally results in a folder full of files that are sorted by somthing (only track title) that isn't very useful.