Building A Tag with Substrings of the original Tag


#1

I am attempting to format portions of the tags in my music library. I would prefer to sort the artist's name by Sir Name first, then First name, and If Applicable, the Middle Name. For example given the two composer's names (this is two different files, not both names on the same file) "James Newton Howard" & "James Horner". I would like to resolve them as: "Howard, James Newton", & "Horner James". Furthermore, is there a way that I can detect when there are two different artists in a tag, seperate them, and processes their names individually, then rewrite the value of the tag in the desired format, i.e.: "Hans Zimmer, Henning Lohner, Martin Tillman" would resolve into "Zimmer, Hans; Lohner, Henning; & Tillman, Martin"

I suppose a lot of this problem boils down to Doing Conditional Testing within an Action. Is any of this possible?

Thank you in advance for any and all help you receive.

BruceM0001


#2

Hi BruceM0001!

Try out the set of actions I've made (attachment).

Just copy the file to "%appdata%\Mp3tag\data\actions" folder and it should be available from action list (ALT+5) in Mp3Tag.

Regards
nickless

BruceM0001.mta (168 Bytes)


#3

nickless,
Thank you for your assistance. I have copied the file to the c:\Program Files\Mp3tag\data\actions" as you instructed, but the "Alt-5" Actions command still does not see the file. Any suggestions?

Thanks again.

BruceM0001


#4

He said that you should copy it to %APPDATA% and not "Program Files". %APPDATA% (you can type that as-is in Windows Explorer since it's a Windows environment variable like %TEMP% and %WINDIR%) is usually "C:\Documents and Settings<i>\Application Data".


#5

Thanks for The Heads Up. I'll Bet It works Now.


#6

Thank you everyone who responded. Other than a minor case of "Short Circuit Between the Operator's Headset", everything went just fine, and the problem has been solved. I would love a bit more indepth explaination of the Regular Expression setup in the solution file. I'm new to regular expressions, and the solution uses a lot of features, on multiple levels.

Thanks Again


#7
(^|; =?)([a-zA-Z -]*) (\S+)(?=$|;) 

It searches for 4 matches (in brackets) and replaces them in order $1$3, $2$4.
First match is beginning of line or "; ", second is a set of chars of length >= 0 , 3-rd is a set of not_whitespaces of length >0 and 4-th end of line or ;, while there must be a space between 2-nd and 3-rd, and 1-st match is a lookbehind and 4-th a lookahead :wink:

RegEx can be a little complex, it's better to read the topic in the Help or have a look at this site.

Regards
nickless

Edit: I've just noticed, that (^|; =?) is not a lookbehind (thx dano), =? is not necessary, only (^|; )([a-zA-Z -]*) (\S+)(?=$|:wink: will work the same way.