Action to create ARTISTSORT tag

I'm looking for help creating actions to do the following in flac files:

Create an ARTISTSORT tag by either:

[1] taking the ARTIST field and reversing first & last names, separated by a comma, as in [lastname], [firstname]. For this purpose I think we can assume that the lastname is the final word in the name. For example, Stevie Ray Vaughan -> Vaughan, Stevie Ray.


[2] taking the ARTIST and deleting any leading articles like "The", "Los", etc.

I want to create two actions for the cases above. One would be used for 'individual artists' and one for 'groups'.

Since many tracks are already have an ARTISTSORT tag, I'd like the action to replace the tag if it already exists, otherwise create one, but it cannot create a second ARTISTSORT tag.

I think I just found the answer to #1 in the pinned post on Regular Expressions:

Regular Expressions

I think I can probably figure out #2 now.

Another question, though: Am I correct in the way I'm doing this?

I have a multi-step action that first copies (format) ARTIST to ARTISTSORT. It then does a regex replace on ARTISTSORT. Is that the right way to do this - in two steps?

Yes, that's is the right way of doing this :slight_smile:

Best regards,
~ Florian