Counter in title, reset on title change with 2nd counter conflict

Hello!
I have been looking to digitize some audiobooks.
My Problem is the following:

  • The Title refers to the chapter from the book.
  • I need the titles formatted in 2 different counters + the name of the chapter

For example;
001 CHAPTER1 1
002 CHAPTER1 2
003 CHAPTER1 3
004 CHAPTER2 1
005 CHAPTER2 2
And so on.

what I have so far:
$num(%track%,3) %title% $num(%_counter%,1)

That however returns:
001 001 CHAPTER1 1
002 002 CHAPTER1 2
003 003 CHAPTER1 3
004 004 CHAPTER2 1
005 005 CHAPTER2 2
and so on.

Is there a way to get rid of the second instance of the total track number?

Many thanks in advance!

Try Convert>Tag-Tag for TITLE
Format string: $num(%track%,3) $replace(%title%,$num(%track%,3) ,) $num(%_counter%,1)

Thanks!
That works for the most part, I still have to select each chapter one at a time, but it is much faster than numbering them by hand.

for reference:
Output on selecting all:
001 CHAPTER1 1
002 CHAPTER1 2
003 CHAPTER1 3
004 CHAPTER2 4

I can however select each chapter on its own and it'll number them accordingly.

Thanks again

I don't think there's a solution for that within Mp3tag.
It would require being able to access the tag content of the previous file in the selection.

Something that would conceivably work might be if Florian adds functionality like $previous(TAG) and $next(TAG) to refer to the TAG value of the previous selected song or the next selected song, but you'd have to create a feature request for that and it might be very complex to implement so there's no saying if he'd actually do it.

Alright then, thank you for clarifying.

I will mark the message by ohrenkino as a solution.