Help - Search - Members - Calendar
Full Version: Changing track number format from x/y to x
Mp3tag Forums > Mp3tag - International > General Discussion
pjetson
For quite some time, I've been "annoyed" by the variations of track number formats in my MP3 files. Some have just digits (my preference), some have leading zeros, some have x/y, and so on. I haven't been able to come up with an easy way to change them. Until now!

V2.51's Convert Tag-Tag function works a treat, but it took a little while to work out how to do it.

Just set the FIELD set to TRACK, and the FORMAT STRING to $add(%track%,0)

I hope this helps someone else.

Regards,
Peter
dano
There is a dedicated function for track number formatting which should be used:

$num(%track%,1)
pjetson
QUOTE (dano @ Jun 18 2012, 19:01) *
There is a dedicated function for track number formatting which should be used:

$num(%track%,1)

Hi, Dano. $num is not a dedicated function for track numbering, it's a general purpose function for turning a number into a string with leading zero padding to the specified number of digits. It can't do what I wanted to do.

The $add function works (as far as I can tell) because it converts the existing track number string into an integer, which effectively drops any zeros before the number, and any non-numeric characters after the track number. It then adds the second argument (in my proposal a zero) to the track number, then converts it back to a string. That's exactly the function that I required to standardise my track numbers, and I thought it may be useful to others.

Regards, Peter

dano
Why not? $num also deals with the x/y format:
$num(5/9,1) => 5
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.