I keep my audio file names with the following template:
[track number] [song title]
For example:
01 Everything in Its Right Place
The friction I’m running into is that my track numbers in the metadata do not include that initial 0 (and I don’t want them to). So if we take a look at my example, the song “Everything in Its Right Place” has a track number of “1”, not “01”. I want to be able to use MP3Tag to rename my files using the track number and title, but I want MP3Tag to add a 0 before the number to the file name when the track number is less than 10. (In other words, I don’t want to add a 0 before 10 so that it would say 010. I want my files to look like: 01 Song, 02 Song, …, 10 Song, 11 Song, etc.)
If I use the “Tag - Filename” action, I’m currently using “0%TRACK% %TITLE%”, and then going through the file names of songs that are track number 10 or more and manually removing the preceding “0” so “010” becomes “10”, “011” becomes “11”, and so on. I’m guessing there’s a better way. Can anyone help me? Thank you for your time!
M4A tag spec stores %track% as integers not strings like MP3/FLAC, so leading zeros are not possible if that’s the file you are working with.
If you want to do tag → filename, you can try: $iflonger(%track%,1,%track%,$num(%track%,2))
Basically, if the %track% length is longer than 1 (e.g., two digits), then %track% will be used, if %track% is 1 digit, then a leading zero will be prepended to %track% in the filename.
Ahh, that’s too bad. I’m on day one of use and MP3Tag is already proving to be invaluable in terms of batch editing both albums and my music library as a whole*. I will be purchasing a license once my trial period runs out, assuming I don’t come across many more “I can’t do this” scenarios. I appreciate you taking the time out to respond, ms6676749.
(*It was so nice to be able to remove disc numbers, comments, composers, and genres from everything, instantly!)
True, I was going to leave it at just $num(%track%,2) because it means that filename track numbers will have 2-digits (leading zeroes if necessary) the very least. Just had a brainfart there.