# Search a field and append another with the results

**URL:** https://community.mp3tag.de/t/search-a-field-and-append-another-with-the-results/12472
**Category:** Support
**Created:** [September 3, 2011, 9:41am UTC](https://community.mp3tag.de/t/search-a-field-and-append-another-with-the-results/12472 "2011-09-03T09:41:45Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![code46](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/7ab992/32.png) [@code46](https://community.mp3tag.de/u/code46)
#### Post date: [September 3, 2011, 9:41am UTC](https://community.mp3tag.de/t/search-a-field-and-append-another-with-the-results/12472/1 "2011-09-03T09:41:45Z")

</div>

Hi all, I've just started learning the true power and flexibility of Mp3tag with its Actions. I've learned how to append fields from the FAQ.

However, what I'm trying to do is more difficult than I can handle at this point which is to search two fields, _parent directory/folder name_ and the _notes_ field, for 'XRCD' and/or 'vinyl' (regardless of case).

If one or both are found, append XRCD or Vinyl to the _comment_ field.  
If both are found, append XRCD;Vinyl to the _comment_ field for example.

Would someone kindly show me how this might be done?

I've tried format value with two steps but the comment field of course will add either/or, not both.  
I don't know the proper syntax to append both (separated by a ';').

T=5  
F=COMMENT  
1=$if($eql(%notes%,[XRCD]),%comment%,XRCD)

T=5  
F=COMMENT  
1=$if($eql(%notes%,[VINYL]),%comment%,vinyl)

---

<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: [September 3, 2011, 9:52am UTC](https://community.mp3tag.de/t/search-a-field-and-append-another-with-the-results/12472/2 "2011-09-03T09:52:20Z")

</div>

You could try a filter first  
%\_filename% HAS XRCD OR %comment% HAS Vinyl  
and its variations.  
the select the filtered files and apply an action to append the data.

---

<div class="post-metadata">

### Author: ![code46](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/7ab992/32.png) [@code46](https://community.mp3tag.de/u/code46)
#### Post date: [September 3, 2011, 10:12am UTC](https://community.mp3tag.de/t/search-a-field-and-append-another-with-the-results/12472/3 "2011-09-03T10:12:02Z")

</div>

Thank you, that's very helpful and has now opened up another facet of Mp3tag to me.

---

<div class="post-metadata">

### Author: ![code46](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/7ab992/32.png) [@code46](https://community.mp3tag.de/u/code46)
#### Post date: [September 4, 2011, 8:28am UTC](https://community.mp3tag.de/t/search-a-field-and-append-another-with-the-results/12472/4 "2011-09-04T08:28:11Z")

</div>

I'm having a little trouble with Last Name, First Name sorting for the ArtistSort field.

I've created an action group as follows:

[#0]  
T= **5**  
F= **ARTISTSORT**  
1= **%artist%**  
   
[#1]  
T= **4**  
F= **ARTISTSORT**  
1=**^(.+)\s(.+)$**  
2= **$2, $1** _(also tried **$2 $1** with no comma)_  
3= **0**

Tried it on the following FLAC album (removed all other tags):  
Artist: Bill Evans  
Album: At Town Hall  
Year: 1967

Result was the same, _Bill Evans_, not _Evans, Bill_ which is what I was expecting in the ArtistSort field.

I have also tried the below to no effect (found here on the forums) what could I be doing wrong?  
  
**^(.+)\\s(.+)$  
^([\w]+),\s([\w]+)  
^(.+),\s+(\w\*)**

---

<div class="post-metadata">

### Author: ![code46](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/7ab992/32.png) [@code46](https://community.mp3tag.de/u/code46)
#### Post date: [September 5, 2011, 1:54am UTC](https://community.mp3tag.de/t/search-a-field-and-append-another-with-the-results/12472/5 "2011-09-05T01:54:52Z")

</div>

Did some more searching for _lastname, firstname_ sorting and I found [this post](https://community.mp3tag.de/t/3483/2) from the very helpful DetlevD and it works.

T=4  
F=ARTISTSORT  
1=(._) (._)  
2=$2, $1  
3=0

I noticed it did not have the backslash character ' **\</b\>' so I'm figuring my earlier troubles have something to do with how the delimiting character is set in my Mp3tag settings.**

_Edit_ Indeed that was the problem. I have semicolon set as the delimiting character (tagging FLAC for squeezebox server and would like AC/DC to stay AC/DC) in Mp3tag. I replaced the backslashes with semicolons in the other expressions and they now also sort to _lastname, firstname_.

---

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [September 5, 2011, 4:55am UTC](https://community.mp3tag.de/t/search-a-field-and-append-another-with-the-results/12472/6 "2011-09-05T04:55:00Z")

</div>

> [@code46](#):
>
> I'm having a little trouble with Last Name, First Name sorting for the ArtistSort field.

see also here:  
[Switching first and last name of Artist](https://community.mp3tag.de/t/11020/2)

---

<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/search-a-field-and-append-another-with-the-results/12472/7 "2026-02-09T12:23:19Z")

</div>


