# Switching first and last name of Artist

**URL:** https://community.mp3tag.de/t/switching-first-and-last-name-of-artist/11020
**Category:** Support
**Created:** [October 28, 2010, 4:57pm UTC](https://community.mp3tag.de/t/switching-first-and-last-name-of-artist/11020 "2010-10-28T16:57:38Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![Flskydiver](https://community.mp3tag.de/user_avatar/community.mp3tag.de/flskydiver/32/8129_2.png) [@Flskydiver](https://community.mp3tag.de/u/Flskydiver)
#### Post date: [May 21, 2011, 9:07pm UTC](https://community.mp3tag.de/t/switching-first-and-last-name-of-artist/11020/7 "2011-05-21T21:07:14Z")

</div>

> [@Flskydiver](#):
>
> Awesome, thanks!

Taking what I've learned here and elsewhere, I've not got the following 5 actions to choose from when renaming Artists in this fashion; perhaps compiling them here may help others. (\*Most of mine are set up as format field with the $regexp function but I tried to standardize them in describing them):

From "First Name(s) **Last Name(s)**" to "**Last Name(s)**, First Name(s)" Format:
1. Transform Artist from "A **B**" to " **B** , A" or "A B **C**" to " **C** , A B"

> ex: "John **Smith**" to " **Smith** , John" or "John Michael **Smith**" to " **Smith** , John Michael"
> 
> Regular Expression Replace: `(.*) (.*)` with: `$2, $1`

1. Transform Artist from "A **B C**" to " **B C** , A"

> ex: "John **Smith Jones**" to " **Smith Jones** , John"
> 
> Regular Expression Replace: `(.*?) (.*)` with: `$2, $1`

1. Transform Artist from "A **B** ©" to " **B** , A ©"

> where "©" is any suffix you like following a two word name
> 
> Regular Expression Replace: `(.*?) (.*) (.*)` with: `$2, $1 $3`

From "**Last Name(s)**, First Name(s)" to "First Name(s) **Last Name(s)**" Format:

4] Transform Artist from " **B** , A" to "A **B**" or " **B** , A ©" to "A **B** ©"

> ex: " **Smith** , John" to "John, **Smith**" or " **Joel** , Billy & Elton John" to "Billy **Joel** & Elton John" 
> 
> Regular Expression Replace: `^([\w]+),\s([\w]+)` with: `$2 $1`
> 
> I find this works well with all two-word names no matter if you've added more stuff to the end and it is safe to run on all artist who DON'T have comma's in their name field too; except for those who have more than two words in their proper name.

5] Transform Artist from " **B C** , A" to "A **B C**" or " **C** , A B" to "A B **C**"

> ex: " **Smith Jones** , John" to "John **Smith Jones**" or " **Smith** , John Michael" to "John Michael **Smith**"
> 
> Regular Expression Replace: `(.*)',' (.*)` with: `$2 $1`
> 
> This simply takes everything before the comma and puts it at the end, which works great for all names, no matter how many words in the first or last, but doesn't play nice with non-name suffixes you may have added (like "Joel, Billy _and Elton John_").

Adding or Removing Leading "The "

6] Restore Leading "The " to Artists' Names

7] Delete Leading "The " and "A " from Artists' Names

[Artist\_Name\_Actions.zip](https://community.mp3tag.de/uploads/default/original/2X/6/68444d5bf7af59372738de21440996369e583580.zip) (1.77 KB)

---

_[View the full topic](https://community.mp3tag.de/t/switching-first-and-last-name-of-artist/11020)._
