# Multiple field manipulation

**URL:** https://community.mp3tag.de/t/multiple-field-manipulation/6974
**Category:** Support
**Created:** [June 26, 2008, 11:36am UTC](https://community.mp3tag.de/t/multiple-field-manipulation/6974 "2008-06-26T11:36:14Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Stevest](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/a698b9/32.png) [@Stevest](https://community.mp3tag.de/u/Stevest)
#### Post date: [June 26, 2008, 11:36am UTC](https://community.mp3tag.de/t/multiple-field-manipulation/6974/1 "2008-06-26T11:36:14Z")

</div>

Hi all,

I use multiple artist fields with the syntax Lastname, Firstname.

For example: Smith, John Arthur for John Arthur Smith

If I need the name in natural order (with a simple artist field), I can use the function

```
$regexp($meta(artist,0),^(.+)','\s*(.+),$2 $1)

```

(Creates 'John Arthur Smith' from field Artist1 'Smith, John Arthur')

How can I do this with several artist in multiple fields?

For example:  
ARTIST1: Smith, John Arthur  
ARTIST2: Doe, Jane  
ARTIST3: Miller, Peter

The required string is:  
John Arthur Smith / Jane Doe / Peter Miller

I think the code must be something like this:  
$regexp( **/** $meta\_sep(artist,'//') **/** ,WHATTOPUTHERE?,$2 $1)  
The green slashes are just an idea. In this case I should examine the part of the code between the two slashes. That is why I use double slashes as separator.

Thank you in advance.

st

---

<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 27, 2008, 4:09am UTC](https://community.mp3tag.de/t/multiple-field-manipulation/6974/2 "2008-06-27T04:09:44Z")

</div>

> [@Stevest](#):
>
> ... I use multiple artist fields with the syntax Lastname, Firstname.  
> For example: Smith, John Arthur for John Arthur Smith ...  
> The required string is: John Arthur Smith / Jane Doe / Peter Miller ...

From multiple artist tagfield:  
'Smith, John Arthur\\Doe, Jane\\Miller, Peter'  
ARTIST:Smith, John Arthur  
ARTIST:Doe, Jane  
ARTIST:Miller, Peter

To some other tagfield or export output:  
'John Arthur Smith / Jane Doe / Peter Miller'

By:  
$regexp($regexp($meta\_sep(temp, / ) / ,(.+?)','\s\*(.+?) / ,$2 $1 / ), / $,)  
or  
$regexp($regexp($meta\_sep(temp,/)/,(.+?)','\s\*(.+?)/,$2 $1 / ), / $,)

DD.20080627.0810.CEST

---

<div class="post-metadata">

### Author: ![Stevest](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/a698b9/32.png) [@Stevest](https://community.mp3tag.de/u/Stevest)
#### Post date: [June 27, 2008, 4:22pm UTC](https://community.mp3tag.de/t/multiple-field-manipulation/6974/3 "2008-06-27T16:22:02Z")

</div>

Thank you very much.

There is only one problem. If the name is only one word (no commas) this code doesn't work.  
Sorry for the bad example list. I should have put Madonna in the list as the second artist. 🙂

I try to find a solution, but still no success...

st

---

<div class="post-metadata">

### Author: ![Stevest](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/a698b9/32.png) [@Stevest](https://community.mp3tag.de/u/Stevest)
#### Post date: [June 28, 2008, 10:32am UTC](https://community.mp3tag.de/t/multiple-field-manipulation/6974/4 "2008-06-28T10:32:11Z")

</div>

Hi again,

I tried to use this:

$regexp($regexp($meta\_sep(artist,~)~,([^~]+?)','\s\*(.+?)~,$2 $1 / ), ~ $,)

but it doesn't work. What is wrong?

The [^~]+?',' means any charachter, except ~ repeated at least once to the first comma, isn't it?

st

---

<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 28, 2008, 5:00pm UTC](https://community.mp3tag.de/t/multiple-field-manipulation/6974/5 "2008-06-28T17:00:36Z")

</div>

Here comes a somewhat hacked solution, there should be also exist a simple regular expression using lookahead or condition or so:  
**$regexp($regexp($regexp($regexp($regexp($meta\_sep(temp,$char(10))$char(10),^'['^',]'+$,$0',~'),^(.+?)','\s\*(.+?)$,$2 $1),^~ ,),\n$,),\n, / )**

From: 'Smith, John Arthur\\Madonna\\Miller, Peter'  
To: 'John Arthur Smith / Madonna / Peter Miller'

DD.20080628.2100.CEST

---

<div class="post-metadata">

### Author: ![Stevest](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/a698b9/32.png) [@Stevest](https://community.mp3tag.de/u/Stevest)
#### Post date: [June 28, 2008, 7:36pm UTC](https://community.mp3tag.de/t/multiple-field-manipulation/6974/6 "2008-06-28T19:36:29Z")

</div>

🙂  
It works. I wouldn't say that I understand the code, but I will study it for a while.  
Thank you very very much for your unbroken support.

---

<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:21pm UTC](https://community.mp3tag.de/t/multiple-field-manipulation/6974/7 "2026-02-09T12:21:01Z")

</div>


