[X] Spaces at the beginning and end of tag fields

I'm not sure if this could be considered a bug, but it really bugs me. :wink:

If I accidentaly select a space before or after the text which I'm copying to any of the tags, it will be saved. For example, if I copy an artist's name from the internet and accidentally select a space before it (very easy to do in a body of text), that space will become the first character of the artist field after saving it, and that artist will show up first when sorting artist names in a list in any audio manager. Also, it's very easy to overlook such things while viewing files in Mp3tag, and it seems to do this for any tag field.

I don't know if there is any special case in which having spaces at the beginning or end of tags would be justified, but if there isn't I would like to recommend changing Mp3tag's default behaviour to deleting those spaces when saving, similar to the way Windows automatically delete them when you try to rename a file.

Other than that, Mp3tag seems pretty much flawless. :smiley:

I am quite glad that MP3tag does not interfere with my input even it is somewhat stupid.
You can find files with leading or trailing blanks (in ARTIST) with the following filter:
"$if($eql($len(%artist%),$len($trim(%artist%))),1,0)" IS "0"

You can get rid of these blanks with an action of the type
"Format tag field"
and the format string

All right, no offense, but I just thought there is no reason for those spaces and they can easily mess things up. But, hey, if there's an action for that, I'm good.

So, what exactly does $trim do?

Trim will remove any leading or trailing blank spaces from a string. So if the string was " Text", then Trim would delete those spaces for you, leaving just "Text".

Read about the functions $trim, $trimLeft, $trimRight in the manual ...


Thanks, both of you.
By the way, is there a way to do this for all of the tags in a file?

you could use %_all% but I wouldn't esp. if you have lyrics somewhere



This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.