feature request - track # formatting


thanks Florian for creating an excellent mp3tagging software

i have a feature request (maybe two)

  1. Whenever I'm retagging and renaming mp3s, I usually use this format "track#-artist-songname" because i want my filenames to be consistant. Is it possible to have an option to set the length of the track number to two digits? (ie, track number 1 should be 01 etc)

  2. A lot of iTune users are tagging the track# kind of strange. They're tagging the track# like this, 1/14 etc. Whenever I rename my mp3 with the track# first, the file name change to 114-artist-songname because the backslash is an invalid character for a filename in windows. Is it possible to make the program Mp3tag stop parsing the track# whenever it reaches a backslash?

not sure if i'm making myself clear on those 2 points. if not, just tell me and i'll try to explain it again.

would be great to see those two features being implemented. but it is ok if u choose not to. Mp3tag is still the greatest mp3 utility ever created

thanks in advance



1.) use the $num build in scripting fuction in your format string, e.g. $num("%track%",2) - %title%

2.) no, this is not possible. But you can easily renumber your files using the auto-numbering wizard via [Ctrl+K].

Best regards,
~ Florian


In a related but opposite request...

I tag my files as "tracknumberwithleadingzero"/"totalnumberoftracks".
Like this:

Is there already a tag to use like %totaltracks% that I could use to autonumber the tracks? If not, could you add this format to the AutoNumber tool?

Related post

Thanks in advance and thanks for the best tagger in the world.


I don't know, if I understand you: Are you thinking of a edit-box at the numbering wizard to enter the name of a custom tag field which will store the totaltracks part?

Best regards,
~ Florian


That would work.

You could also just add another check box that says something to the effect of "Add total number of tracks to the end of track number".

So the track numbers would be:


This is already possible with the Autonumbering Wizard and the option Save total count of tracks.

Best regards,
~ Florian


Well.... that works. Whadya know...

Now don't I feel sheepish.

Thanks Florian.


I can renumber according to the order of the rows but how do I reorder the rows other than clicking on the column header? I need to order by hand! I think I've tried all free programs but couldn't figure out how to do this imho common task :frowning:




simply hold the [Alt]-key down, while re-ordering the files with the mouse.

Best regards,
~ Florian


thanks, I tried to look in the docs but obviously I failed. I have tried modifiers + arrows but that didn't do the trick. I should have tried modifiers + mouse as well. It seems it works only with single selection, maybe you could rework it a little, multiselect is probably a little tricky to program, I've done it in one of my apps, keys and menu items (so I can skip reading docs :slight_smile: would be fine. Maybe again I'm to impatiently and overlooked something


ok maybe this is getting a little off topic but anyway:

This is good if you know the trick :slight_smile:
However, it would be nice to move multiple tracks at a time this way. I stumbeled a few times about track orders like
...and so on

In this case I have to move 4 files individually instead of moving them all at one time.

also I am curious why foobar icons are changeing their color on moving.



Do a regexp-replace and change ^(.)/.$ to $1 in the TRACK field.

You might also want to do another, replacing ^0*([0-9]+?) with $1 if you don't like leading zeroes in the track field.


Is there any way to do the similar thing (strip leading zeroes) in one step when converting Filename - Tag?
Something like 'reversed' $num("%track%",2) behavior when used in Filename - Tag conversion maybe?
And IMO stripping leading zeroes when converting Filename - Tag should be default behavior. Unlikely that somebody would want to have '01' in his tags. At least I haven't ever met such tags so far. :slight_smile:

By the way, if I'm not mistaking Total Commander manages to sort properly cases like:

I.e. it sorts the 10th track after the 9th, not the 1st.
It would be great if Mp3tag could do the same trick when sorting by file name. :slight_smile:


$num(%track%,1) will remove any leading zeros if that is what you want. It has been answered several times on this forum already.

As for sorting, since the filename is a string, string sorting is used. If you want to sort by track, add a new column to display the track, mark it as being numeric then sort by track and then by path. I think it should work, although I am not sure.


I can't tell you how many times I have wanted to move the files around, and couldn't do it. Now I read a two year old thread and I learn the secret :flushed:


I love this program more every day . . . :book:


You've missed the point.
I know how to remove leading zeros when converting Tag - Filename. But I see no way to conveniently remove leading zeros when converting Filename - Tag. One has first perform the conversion and then additionally run transformation action to remove zeros. :frowning:
IMO they should be removed by default when performing Filename - Tag conversion.

As for sorting.. consider the following situation:
I have a bunch of files without tags (and so without track numbers to sort by). But they have pretty complete file names (with track numbers).
To run Autonumbering Wizard I have first to reorder them appropriately. :frowning:
But if Mp3tag could sort file names in the way Total Commander does - I wouldn't have to! Tracks already would be in appropriate order for running wizard!
Just a little bit more intelligence that will ease the thing. :slight_smile:

Yet another idea that came across my mind just now: when performing Filename - Tag conversion Mp3tag could try to guess conversion pattern based on selected files names. I.e. find the most probable configuration of placeholders and separators. So in most cases user will not need to change something.
Just another cool piece of intelligence. :slight_smile:


For sorting, the only thing that comes into my mind would be adding a new column with this value: $mid(%_filename%,1,$sub($strchr(%_filename%, ),1)) and setting it to numeric.


For all those filenames which begin with a zero sign, you may use something like this:
Formatstring: 0%track%_%other% (the underline char may be a space in your case)



Still have two operations to convert filenames to tags for the whole album. :frowning:
In this situation I would prefer to convert the whole album as a firts step and then run script stripping leading zeros.


Well, you could also create an action set which combines everything (Guess values for filename --> tag and Format values for removing leading zeros). Then simply select all files, and run the action set. But really, is clicking the mouse button twice really that difficult? :rolleyes: