Manipulating Track Number


#1

Hello.
I have a list of MP3's with their respective Track number.

I want to add 5 to each track number.

I tried:
Convert -> Actions -> New Action

I chose "Replace".
I chose:
Field - "TRACK".
Original - That's the tricky one, What should I chose? It's different each time. Tried %track%.
Replace With - $add(%track%, 5).

Yet it didn't work.
Any advise?
Thanks.


#2

If this need is a one time shot, then use the Tracknumber Assistant [Ctrl+K].

If you need such renumbering every now and then, then you can define an action, which does the math and set the tag field.
Action: Format value
Tag field: TRACK
Format string: $add(%TRACK%,5)

By the way ... the $replace() function respectively the action "Replace" is designed for textual replacement within a text string.
To "replace" the content of a tag field use the action "Format value".

DD.20100627.1820.CEST


#3

Thanks, Worked Perfectly.
Though I didn't get why "Replace" wouldn't work.

Is there a way to read the %track% as text an manipulate it using replace?


#4

You can use the action "Format value" along with the function $replace(string,from,to):
Action: Format value
Tag field: TRACK
Format string: $replace(%TRACK%,%TRACK%,$add(%TRACK%,5))

The action "Replace" does not support tag field placeholders for the parameters
"Original" and "Replace with". Both parameters seems to be allowed to be literals only.

The action "Replace with Regular Expression" might do the trick.
Action: "Replace with Regular Expression"
Tag field: TRACK
Regular expression: ^\d+
Replace matches with: $add($0,5)

DD.20100617.0543.CEST