Extract text from filename and place in tag

Hi folks,

I have a little problem. I have a collection of 44yrs worth of top hits and the filenames contain the year and the rankings. The mp3 tags are empty. What I am trying to do is to extract information from the filename and place it in the tags.

Here are a couple of examples of the filenames

4 FRESHMEN - GRADUATION DAY (1956 #17).MP3
5 SATINS - IN THE STILL OF THE NIGHT (1956 #24-R3).MP3
BILL DOGGETT - HONKY TONK (PART 1) (1956 #2-R1-13).MP3

The way I would like to do it is extract the artist and title and place it in the appropriate tags. Then out of the () portion which contains the year and ranking extract the 4 digit yr and place it in the year tag. Finally take all the info enclosed within the () containing the year and place it in the comments tag.

Since some songs actually have two sets of () I need to be able to have the script check to make sure that the () contain the year and not text like in the 3rd example.

From reading the help I am pretty sure that I have to use the scripting functions like "$strchr(x,y)" and "$strrchr(x,y)" and "_FILENAME" as part of the command, but that is as far as I have gotten.

Any help would be greatly appreciated since there are 7836 :w00t: mp3s that I need to edit like this.

Doc77

The format of the example filenames look as they allow simply extracting the data from the filenames by a converter dialog, there are enough and useful delimiter characters between the data.
In general I suggest that you divide your problem into smaller parts.
Use the Mp3tag Filter and create groups of filenames of always the same format.
Then use Convert "Filename - Tag" with the appropriate mask string.
Put the complete content from within the round brackets always completely into the COMMENT tag field or into some user defined tag field.
Extracting the year only can be handled afterwards in a second run using another mask string or by an action of type "Guess Value" running against the COMMENT tag field.

Note:
First try out the different processes with an appropriate test file, one for each case.
What works for one, that will work for millions.

DD.20100823.1205.CEST