# Need some help with IF

**URL:** https://community.mp3tag.de/t/need-some-help-with-if/16614
**Category:** Web Sources Discussion
**Created:** [February 20, 2015, 6:41pm UTC](https://community.mp3tag.de/t/need-some-help-with-if/16614 "2015-02-20T18:41:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![skrippi](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@skrippi](https://community.mp3tag.de/u/skrippi)
#### Post date: [February 20, 2015, 6:41pm UTC](https://community.mp3tag.de/t/need-some-help-with-if/16614/1 "2015-02-20T18:41:13Z")

</div>

Hey guys,

i want artist and mixartist within the artist field and seperated by comma. But how is this possible?

Temporary it's like this:

```
    outputto "ARTIST" # ARTIST
    sayregexp "(?<=,\"artistName\":\")[^\"]+" ", " "<<endTrack>>"
    say ", "
    sayregexp "(?<=,\"remixerName\":\")[^\"]+" ", " "<<endTrack>>"
    say "|"

```

Problem is, that the comma is set in any case. I dont now how to use the if clause...  
Help would be very nice 🙂

Greez, skrippi

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [February 21, 2015, 9:25am UTC](https://community.mp3tag.de/t/need-some-help-with-if/16614/2 "2015-02-21T09:25:09Z")

</div>

QUOTE (skrippi @ Feb 20 2015, 20:41) \<{POST\_SNAPBACK}\>

Hey guys,

i want artist and mixartist within the artist field and seperated by comma. But how is this possible?

Temporary it's like this:

```
    outputto "ARTIST" # ARTIST
    sayregexp "(?<=,\"artistName\":\")[^\"]+" ", " "<<endTrack>>"
    say ", "
    sayregexp "(?<=,\"remixerName\":\")[^\"]+" ", " "<<endTrack>>"
    say "|"

```

Problem is, that the comma is set in any case. I dont now how to use the if clause...  
Help would be very nice 🙂

Greez, skrippi

  
isn't this more or less the same problem as the one you asked in this thread  
[beatport.com scripts by stevehero (search & direct) - jaimz mod](https://community.mp3tag.de/t/12568/264)?

I do not understand the necessity to merge 2 fields into one without having the original structured data in separate fields. If you still have the mixartist in the field MIXARTIST, you can strip it from the ARTIST field, once you get annoyed with the flood of artist-mixartist-combinations.  
So if you apply filters and actions to copy the data from MIXARTIST to ARTIST, you would not have to include an IF statement. This will eventually lead to an easier process to update the script, once updates are available as you have fewer local modifications.

---

<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: [February 21, 2015, 9:58am UTC](https://community.mp3tag.de/t/need-some-help-with-if/16614/3 "2015-02-21T09:58:14Z")

</div>

> [@skrippi](#):
>
> Hey guys, i want artist and mixartist within the artist field and seperated by comma. But how is this possible? ... Problem is, that the comma is set in any case. I dont now how to use the if clause... Help would be very nice 🙂 Greez, skrippi

Obviously ... while you ... and me ... do have no deeper knowledge how to apply the "Mp3tag Websource Scripting Language" within a websource script, ...  
in order to remove a trailing comma ... or better ... simply not to "say" a trailing comma, ...  
you are free to apply a following Mp3tag action, e. g. "Format value", ...  
for the fine-tuning, after importing websource values, for example ...  
ARTIST \<== $trimRight(%ARTIST%,',')

DD.20150221.1159.CET
