I have thousands of tags showing the full name for composers in the normal conversational way, such as Maurice Ravel. However, for various reasons, I've decided that I'd like that field to have a different format: either as "Ravel, Maurice," or, if that's not possible, just "Ravel." How can make one or the other of those changes in one pass for the composer field in all my tracks? Please also cover an additional trick that would allow such a change to be made for the few people who have multi-part names, like "Ludwig von Beethoven."
Please check out the FAQs first:
And then use the search function with search words like "swap name"
I didn't realize MP3Tag has a FAQ's section. That's not one of the categories in the left panel of the general community page, or the "support" section.
I'm afraid the article you referenced is way beyond my capabilities. I don't have any experience or understanding of "regular expressions," Perl or otherwise.
The specific text you cite is tantalizing because it appears like it would provide the answer. "$ vs \ in replacement section. e.g. swap artist name. Mercury, Freddy --> Freddy Mercury RegExp: (\w+),(\w+) ReplaceWith: \2, \1 \2, \1 is equivalent to $2, $1 and ${2} ${1}" apparently describes a way to produce the result I want, but I don't understand what to do with the info.
Can you provide me with the specific expression that I'd need, and then an explanation of how to apply that expression to change thousands of files?
Try an action of the type "Format value" or use Convert>Tag-Tag for COMPOSER
Format string: $regexp(%composer%,(.*) (.*),'$2, $1')
On a footnote: see also this discussion about the pros and cons of swapping name parts plus the option to use the ~SORT fields.
Are you sure that you really want to use the COMPOSER field for this purpose?
There would be a field called COMPOSERSORT.
Of course it depends on your use case and if your player is reading and displaying this field.
Rather than trying to find a player that uses the "composer" tag, I've standardized on treating the composer as the "artist," and I display their name in the conventional way there. I want to have the "composer" field formatted differently so I can sort and find my tracks more easily. Finding what I have by Beethoven is no problem, whether I sort by first or last name, because I know both instantly. But where are my tracks by Lalo, or Franck, or a host of others that I need to think about or filter to find? Accordingly, it will just work better to have the composer field sort by last name instead of first.
Thanks for your caution.
In other words, when I want to see what tracks I have by Beethoven, I want to go
It's your collection - feel free to use it however you like!
I'm just curious:
Where do you fill the information that Artur Rubinstein or Claudio Arrau or Wilhelm Kempff was the ARTIST playing Beethoven's piano concertos in your track?
Ludwig van Beethoven certainly was the COMPOSER of many piano concertos.
However different ARTIST have played them in their own style.
For the performers, I use the Album Artist field, and have a fixed sequence in there of CONDUCTOR/ ORCHESTRA/SOLOIST. For instance: Martin Turnovský, Orchestra Of The Wiener Musikverein, Ivan Moravec.
Well, this is amazing! I don't know what I'm doing, but I select the tracks, choose a quick action, bill in your values--and it does the job! Since it came from you, I expected this would work to transform Maurice Ravel, but don't understand how the same formula can also properly transform Wolfgang Amadeus Mozart.
I think my recent answers to LyricsLover indicate why I wanted to make these changes.
Thanks again for being there!
Explanation for:
$regexp(%composer%,(.*) (.*),'$2, $1')
This regular expression tries to match "everything until - but not including - the last space" in COMPOSER and put it into the capture group #1. Then it tries to match "everything else" and put it into the capture group #2.
Then the regular expression replaces the current content of the target field with the content of the second capture group, followed by comma and a space and then the content of the first capture group.
This way it works for Maurice Ravel the same way as for Wolfgang Amadeus Mozart.
It gets difficult for composer names like Carl Maria von Weber or Johann Nepomuk von Hummel or Johann Strauss II ![]()
Thanks for your explanation. I now understand how that strange looking string of characters worked its magic.
It's funny that you'd mention "Johann Strauss II," because, sure enough, the process failed there. Fortunately, I didn't have many tracks of his work, and it was an easy manual fix.
I avoided any problem with Hummel because Wikipedia identifies him simply as "Johann Nepomuk Hummel," rather than Johann Nepomuk von Hummel, so the expression worked like a charm.
Thanks again for your help.