# Problems with Track number

**URL:** <https://community.mp3tag.de/t/problems-with-track-number/52172>\
**Category:** Support\
**Created:** [February 27, 2021, 8:32pm UTC](https://community.mp3tag.de/t/problems-with-track-number/52172 "2021-02-27T20:32:01Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnknight](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@johnknight](https://community.mp3tag.de/u/johnknight)\
**Post date:** [February 27, 2021, 8:32pm UTC](https://community.mp3tag.de/t/problems-with-track-number/52172/1 "2021-02-27T20:32:01Z")

</div>

Hi,

Newbie here - I would be grateful for any help on creating an action

I've recently converted over to a DS Music server. In the past I've always tagged tracks in a double album as disk 1 of 1 and numbered the tracks as if they were a single album. On the music server it doesn't like this and it takes my original track 18 (which was track 1 on the second disk) and renamed it to 1\18 - this has screwed up the sort order of the tracks.  
So I'm left with 2 choices.. I either renumber them back by taking the digit(s) after the \ or (and this would probably make more sense) I set the disk number for 2 for any tracks containing \  
I've tried creating a variety of actions but I'm really struggling..

$ifgreater($strstr(%Track%),'\'),0,2) gives me a syntax error - this is to set the track value  
$if($len($trim(%track%))\>2,2,1) only returns one value - this is to set the disk number  
$ifgreater($strstr(%Track%),'\'),0,'2','1') again a syntax error - this is to set the track value

Any advice would be appreciated

Thanks JK

---

<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:** [February 27, 2021, 9:07pm UTC](https://community.mp3tag.de/t/problems-with-track-number/52172/2 "2021-02-27T21:07:51Z")

</div>

> [@johnknight](#):
>
> $strstr(%Track%),''),

is invalid syntax, it should be `$strstr(%track%,\)`  
Also, I think that the slash is actually `/`and not `\`.  
$ifgreater syntax is also invalid as the false part is missing.  
So it should be something like  
`$ifgreater($strstr(%Track%,/),0,2,3)`

---

<div class="post-metadata">

**Author:** ![johnknight](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@johnknight](https://community.mp3tag.de/u/johnknight)\
**Post date:** [February 28, 2021, 10:24am UTC](https://community.mp3tag.de/t/problems-with-track-number/52172/3 "2021-02-28T10:24:20Z")

</div>

Hi ohrenkino - thank you for the response.

The character is a back slash in the track field (not that that should make a difference to a formula). Not sure how to insert an image...

![Screenshot 2021-02-28 101302](https://community.mp3tag.de/uploads/default/original/2X/3/35c348382d152f3c498ba21abf6194daf653c890.jpeg)

I tried adding the following action based on your advice..

$ifgreater($strstr(%Track%,),0,2,1)

The logic being if the Track contains \ set disknumber to 2 otherwise 1

![Screenshot 2021-02-28 101735](https://community.mp3tag.de/uploads/default/original/2X/9/9b33bc9efffaead6b497aefe49956078c9c08c2b.jpeg)

Unfortunately this action doesn't appear to effect disknumber at all

Thanks JK

---

<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:** [February 28, 2021, 10:34am UTC](https://community.mp3tag.de/t/problems-with-track-number/52172/4 "2021-02-28T10:34:54Z")

</div>

You can test such an expression in Convert\>Tag-Tag.

I tested `$ifgreater($strstr(%Track%,/),0,2,1)` on a file with TRACK `10/15` and the result was 2.

---

<div class="post-metadata">

**Author:** ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)\
**Post date:** [February 28, 2021, 10:37am UTC](https://community.mp3tag.de/t/problems-with-track-number/52172/5 "2021-02-28T10:37:06Z")

</div>

The double backslash indicates duplicate track fields. If you inspect them via the extended tag dialog, you should see more than one `TRACK` field.

You can remove them either manually or by using a Quick Action of type _Remove duplicate fields_ if you want to do this in batch.

---

<div class="post-metadata">

**Author:** ![johnknight](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@johnknight](https://community.mp3tag.de/u/johnknight)\
**Post date:** [February 28, 2021, 10:51am UTC](https://community.mp3tag.de/t/problems-with-track-number/52172/6 "2021-02-28T10:51:41Z")

</div>

Thanks for the reply  
Have you tried this with a \ character instead of / as per my screen print. I coped your action and replaced the forward slash with a back slash. On the second row in my screen print - 1\18 it set both the Track and the Discnumber to 1

---

<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:** [February 28, 2021, 10:54am UTC](https://community.mp3tag.de/t/problems-with-track-number/52172/7 "2021-02-28T10:54:17Z")

</div>

> [@johnknight](#):
>
> Have you tried this with a \ character instead of / as per my screen print

No. See @Florian 's post about multi-value fields.  
I would like to add to that that you can also merge the duplicate fields and use the slash as separator which turn the whole thing into a more standard TRACK field.

---

<div class="post-metadata">

**Author:** ![johnknight](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@johnknight](https://community.mp3tag.de/u/johnknight)\
**Post date:** [February 28, 2021, 10:59am UTC](https://community.mp3tag.de/t/problems-with-track-number/52172/8 "2021-02-28T10:59:18Z")

</div>

Thanks Florian,

If I look at the extended tag dialog I see 2 track fields:

![Screenshot 2021-02-28 105408](https://community.mp3tag.de/uploads/default/original/2X/9/9edf36185d73470ee27d421f35a8a6b4c2983f8b.jpeg)

18 was the original track number before the media server formatted it to 1\18  
What will remove duplicate fields do - will it restore the 18? My preferred option is to keep it at 1 and change the disk number but I'm not having much look getting MP3Tag to recognise the \ characters to create a quick action.

---

<div class="post-metadata">

**Author:** ![johnknight](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@johnknight](https://community.mp3tag.de/u/johnknight)\
**Post date:** [February 28, 2021, 11:07am UTC](https://community.mp3tag.de/t/problems-with-track-number/52172/9 "2021-02-28T11:07:11Z")

</div>

I can remove duplicate fields but I end up with 2 x Track 1, 2 x Track 2 etc. I was hoping for a way of setting the disk number automatically before eliminating duplicate tracks. I'm not sure this is possible

---

<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:** [February 28, 2021, 11:19am UTC](https://community.mp3tag.de/t/problems-with-track-number/52172/10 "2021-02-28T11:19:57Z")

</div>

> [@johnknight](#):
>
> I can remove duplicate fields

That is why I suggested that you use the "Merge duplicate fields" instead and then check what the contents is and manipulate TRACK first.

---

<div class="post-metadata">

**Author:** ![johnknight](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@johnknight](https://community.mp3tag.de/u/johnknight)\
**Post date:** [February 28, 2021, 11:32am UTC](https://community.mp3tag.de/t/problems-with-track-number/52172/11 "2021-02-28T11:32:37Z")

</div>

I tried merging duplicate fields as follows:

![Screenshot 2021-02-28 112736](https://community.mp3tag.de/uploads/default/original/2X/4/4fb9ed04e3588cc7687f780a42a38f1df108dfde.jpeg)

This appears to do nothing - track doesn't change. I'm not sure if this is because I have some tracks that don't have the separator (I ran it across all tracks in the directory)

I've found a fairly fast way to do this manually - manually selecting the records which were on disk 2 then applying an action on those records to set diskNo =2 and finally eliminating duplicates.  
Thanks JK

---

<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:** [February 28, 2021, 11:55am UTC](https://community.mp3tag.de/t/problems-with-track-number/52172/12 "2021-02-28T11:55:44Z")

</div>

The trick is not use the double-backslash - as MP3tag uses that as separator between multi-value fields - and you get a multi-value field straight away again after you have merged it.  
That is why I suggested that you use the single slash as separator. The single slash also looks a lot more like an ordinary track field with current track and total tracks.

---

<div class="post-metadata">

**Author:** ![johnknight](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@johnknight](https://community.mp3tag.de/u/johnknight)\
**Post date:** [February 28, 2021, 11:58am UTC](https://community.mp3tag.de/t/problems-with-track-number/52172/13 "2021-02-28T11:58:37Z")

</div>

Ok ohrenkino will give that a try. Thanks for your persistence!

---

<div class="post-metadata">

**Author:** ![johnknight](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@johnknight](https://community.mp3tag.de/u/johnknight)\
**Post date:** [February 28, 2021, 12:40pm UTC](https://community.mp3tag.de/t/problems-with-track-number/52172/14 "2021-02-28T12:40:35Z")

</div>

Hi, the merge worked in that in enabled me to se the TRACk as a string and parse out the data. This is what I did....

![Screenshot 2021-02-28 123538](https://community.mp3tag.de/uploads/default/original/2X/c/cf046855474b0e8c327ec7a29c7ec2e5e81d3eb4.jpeg)

So the first action removes a \ and it is now a string I manipulate  
Using the single \ I create the disk number  
The final action takes the correct track number for the disk - I had to trim as it was leaving a space at the end

Many thanks for your help - its much appreciated

---

<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:** [March 30, 2021, 12:41pm UTC](https://community.mp3tag.de/t/problems-with-track-number/52172/15 "2021-03-30T12:41:11Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
