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


#1

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:


#2

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
$trim(%artist%)


#3

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?


#4

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".


#5

Read about the functions $trim, $trimLeft, $trimRight in the manual ...
http://help.mp3tag.de/main_scripting.html

DD.20120904.0806.CEST


#6

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


#7

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


#8

/t/967/1


#9

Thanks