Automating Changes to Artist Values


#1

I am undertaking a major re-tagging exercise and wish to standardise Artist entries in the format 'Last name, First Name'. At present a huge number of entries are in the format 'First name, Last Name' and I want to change all of these so that. for example, 'John Coltrane' becomes 'Coltrane, John'.

Is there a way I can set up an action to automate this?


Switch multiple First and Last names
#2

Read there ...
Regular Expressions
Regular Expressions
Multiple value artist tag to multiple value artistsort
Need help with regex for ARTISTSORT

Action: Format value
Field: ARTIST
Format string: $regexp(%ARTIST%,'([^;]+)(\s[^;]+)','$2, $1')

From:
"Rolling Stones"
To:
" Stones, Rolling"

From:
"John Lewis;Mick Jagger;Ringo Harrison"
To:
" Lewis, John; Jagger, Mick; Harrison, Ringo"

DD.20120629.1914.CEST


#3

Many Thanks, DetlevD. Unfortunately at present the Action leaves me with a leading space at the beginning of the new name, which of course means that my control point now puts it at the beginning of the alphabetical sort. I have experimented but can't work out how to amend the format to ensure that there is no leading space in the new name.


#4

Have a look at the trim functions $trim, $trimLeft, $trimRight to remove surrounding spaces.

Try this ... for only one artist name

$regexp(%ARTIST%,'([^;]+)\s([^;]+)','$2, $1')

Try this ... for multiple artist names

$trimLeft($regexp(%ARTIST%,'([^;]+)(\s[^;]+)','$2, $1'))

... or ...

$trimLeft($regexp(%ARTIST%,'([^;]+)\s([^;]+)',' $2, $1'))

DD.20120630.1120.CEST


Help with mutli artist display
Using rexexp on multiple tag fields
Words Count
#5

That worked fine, DetlevD. It will save me an enormous amount of work. Many Thanks for your help.