# Parsing Discogs track ID into two separate values

**URL:** https://community.mp3tag.de/t/parsing-discogs-track-id-into-two-separate-values/65656
**Category:** Support
**Created:** [August 18, 2024, 1:53pm UTC](https://community.mp3tag.de/t/parsing-discogs-track-id-into-two-separate-values/65656 "2024-08-18T13:53:13Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Sexycowboy32](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/35a633/32.png) [@Sexycowboy32](https://community.mp3tag.de/u/Sexycowboy32)
#### Post date: [August 18, 2024, 1:53pm UTC](https://community.mp3tag.de/t/parsing-discogs-track-id-into-two-separate-values/65656/1 "2024-08-18T13:53:13Z")

</div>

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

```auto
$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?

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [August 18, 2024, 1:57pm UTC](https://community.mp3tag.de/t/parsing-discogs-track-id-into-two-separate-values/65656/2 "2024-08-18T13:57:46Z")

</div>

> [@Sexycowboy32](#):
>
> I'm trying to write an action for `%DISCNUMBER%` to automatically match "A" with "01" for example.

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.

---

<div class="post-metadata">

### Author: ![Sexycowboy32](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/35a633/32.png) [@Sexycowboy32](https://community.mp3tag.de/u/Sexycowboy32)
#### Post date: [August 18, 2024, 2:21pm UTC](https://community.mp3tag.de/t/parsing-discogs-track-id-into-two-separate-values/65656/3 "2024-08-18T14:21:18Z")

</div>

alright, that did it!  
Thank you very much.

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

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [August 18, 2024, 2:23pm UTC](https://community.mp3tag.de/t/parsing-discogs-track-id-into-two-separate-values/65656/4 "2024-08-18T14:23:47Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:30pm UTC](https://community.mp3tag.de/t/parsing-discogs-track-id-into-two-separate-values/65656/5 "2026-02-09T12:30:20Z")

</div>


