# Automating Changes to Artist Values

**URL:** https://community.mp3tag.de/t/automating-changes-to-artist-values/13595
**Category:** Support
**Created:** [June 29, 2012, 2:50pm UTC](https://community.mp3tag.de/t/automating-changes-to-artist-values/13595 "2012-06-29T14:50:07Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![gjs1066](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/a9adbd/32.png) [@gjs1066](https://community.mp3tag.de/u/gjs1066)
#### Post date: [June 29, 2012, 2:50pm UTC](https://community.mp3tag.de/t/automating-changes-to-artist-values/13595/1 "2012-06-29T14:50:07Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [June 29, 2012, 2:56pm UTC](https://community.mp3tag.de/t/automating-changes-to-artist-values/13595/2 "2012-06-29T14:56:58Z")

</div>

> [@bluewammer](#):
>
> ... 'First name, Last Name' and I want to change all of these so that. for example, 'John Coltrane' becomes 'Coltrane, John'.

Read there ...  
[Regular Expressions](https://community.mp3tag.de/t/521/27)  
[Regular Expressions](https://community.mp3tag.de/t/521/15)  
[Multiple value artist tag to multiple value artistsort](https://community.mp3tag.de/t/12599/1)  
[Need help with regex for ARTISTSORT](https://community.mp3tag.de/t/12653/1)

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

---

<div class="post-metadata">

### Author: ![gjs1066](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/a9adbd/32.png) [@gjs1066](https://community.mp3tag.de/u/gjs1066)
#### Post date: [June 30, 2012, 5:56am UTC](https://community.mp3tag.de/t/automating-changes-to-artist-values/13595/3 "2012-06-30T05:56:42Z")

</div>

> [@DetlevD](#):
>
> Read there ...  
> [Regular Expressions](https://community.mp3tag.de/t/521/27)  
> [Regular Expressions](https://community.mp3tag.de/t/521/15)  
> [Multiple value artist tag to multiple value artistsort](https://community.mp3tag.de/t/12599/1)  
> [Need help with regex for ARTISTSORT](https://community.mp3tag.de/t/12653/1)
> 
> 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

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.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [June 30, 2012, 7:01am UTC](https://community.mp3tag.de/t/automating-changes-to-artist-values/13595/4 "2012-06-30T07:01:12Z")

</div>

> [@bluewammer](#):
>
> 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.

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

---

<div class="post-metadata">

### Author: ![gjs1066](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/a9adbd/32.png) [@gjs1066](https://community.mp3tag.de/u/gjs1066)
#### Post date: [June 30, 2012, 8:39am UTC](https://community.mp3tag.de/t/automating-changes-to-artist-values/13595/5 "2012-06-30T08:39:40Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:23pm UTC](https://community.mp3tag.de/t/automating-changes-to-artist-values/13595/6 "2026-02-09T12:23:55Z")

</div>


