# 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:** 1
**Showing post:** 4

<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

---

_[View the full topic](https://community.mp3tag.de/t/automating-changes-to-artist-values/13595)._
