Parsing Discogs track ID into two separate values

Hi,

I'm adding metadata to my vinyl collection, using discogs release ID's.
My files are named 0101, 0102, 0201,0202, etc [disc][track].
When retrieving from discogs, the values of track are A1, A2, B1, B2, etc.
While I like that format, my player won't recognize them.
I would like to keep these values in a separate field.

I'm trying to write an action for %DISCNUMBER% to automatically match "A" with "01" for example.
I tried with

$if($mid(%track%,1)=A,01,$if($mid(%track%,1)=B,02,$if($mid(%track%,1)=C,03,$if($mid(%track%,1)=D,04,??))))

It's messy, I know..
It correctly renamed side A to "01", but also side B to "01".

I'm going to do it similar to %TRACK%, but some of the files are from Shellac records, where tracks don't have number, but are only named "A" or "B". These i would like to rename to "01".

Is there other scripting functions that would work better for this purpose?

You could try an action of the type "Format value" for DISCNUMBER
Format string: $num($sub($ord(%track%),64),2)
Which requires TRACK to begin with a capital letter.

alright, that did it!
Thank you very much.

In $sub($ord(%track%),64), what does 64 represent?

65 is the ASCII code for A. 65-64=1