Formatting my track and disc numbers differently

Hi. First time posting here and was looking for a little help involving scripting.

My discnumbers are currently in the format of n/m and what i want to do is reformat so DISCNUMBER = n and DISCTOTAL = m. Obviously this means parsing the current data so that all to the left of the "/" are written to DISCNUMBER and all to the right of "/" are written to DISCTOTAL. But this is where I'm having difficulty. I'm reading through the help site and have come across the scripting functions, which seem to be what I'm looking for. However, I don't seem to be making too much progress.

Can anyone point me in the right direction?

Many thanks :wink:

Welcome 'vaskark'.
There are several ways to do it with Mp3tag.

Use a sequence of actions together with scripting functions ...
... copy content from DISCNUMBER to DISCTOTAL ...
... and remove the unwanted parts in both tag-fields ...

Action: Format value
Field: DISCTOTAL
Format string: %DISCNUMBER%

Action: Format value
Field: DISCNUMBER
Format string: $num(%DISCNUMBER%,1)

Action: Format value
Field: DISCTOTAL
Format string: $reverse($num($reverse(%DISCNUMBER%),1))

... or use one action to split the given values into two tag-fields ...

Action: Guess values
Source format: %DISCNUMBER%
Guessing pattern: %DISCNUMBER%/%DISCTOTAL%

... or use the converter "Tag -Tag" together with scripting functions ... by two steps ...

Field: DISCTOTAL
Format string: $regexp(%DISCNUMBER%,'^(\d+)/(\d+)$','$2')

Field: DISCNUMBER
Format string: $regexp(%DISCNUMBER%,'^(\d+)/(\d+)$','$1')

Good luck.

DD.20140126.0847.CET

Hi, DetLevD! Thank you so much for your thoughtful reply. I decided to use the Guess Values option like so:

Action: Guess values
Source format: %DISCNUMBER%
Guessing pattern: %DISCNUMBER%/%DISCTOTAL%

AND

Action: Guess values
Source format: %TRACK%
Guessing pattern: %TRACK%/%TRACKTOTAL%

... and it worked perfectly!

However, I have encountered a snag. In foobar2000 (my new fav music player) I was looking at the tags of one of my newly-changed songs and I noticed this:

http://i.imgur.com/kIYexbB.jpg

Foobar2000 doesn't seem to understand the TRACKTOTAL and DISCTOTAL tags and hasn't mapped them properly to "Total Tracks" and "Total Discs". Is this something I'm just going to have to live with? I guess it's not a big deal. Just wondering. Or is even formatting my track and disc tags in this new way even worthwhile? I'm now wondering if I should just leave well enough alone :slight_smile:

Anyway, if you have an opinion I'd love to hear it. If not, once again you have my thanks.

Read there ...
Foobar2000:ID3 Tag Mapping
http://wiki.hydrogenaudio.org/index.php?ti...ID3_Tag_Mapping

DD.20140126.1927.CET