# Filter based on differing Artist or Composer

**URL:** https://community.mp3tag.de/t/filter-based-on-differing-artist-or-composer/13098
**Category:** Support
**Created:** [February 15, 2012, 11:34pm UTC](https://community.mp3tag.de/t/filter-based-on-differing-artist-or-composer/13098 "2012-02-15T23:34:59Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![daanodinot](https://community.mp3tag.de/user_avatar/community.mp3tag.de/daanodinot/32/5252_2.png) [@daanodinot](https://community.mp3tag.de/u/daanodinot)
#### Post date: [February 15, 2012, 11:34pm UTC](https://community.mp3tag.de/t/filter-based-on-differing-artist-or-composer/13098/1 "2012-02-15T23:34:59Z")

</div>

Hi,

I'd basically like to create two lists: one contains all tracks that have an ARTIST tag that differs from the track's ALBUMARTIST. For example, ALBUMARTIST is "Michael Jackson": if the ARTIST tag contains anything other than "Michael Jackson" I want it in the list. The second list contains all tracks that have a COMPOSER tag that differs from a _specified string_. The specified string is necessary because the COMPOSER tag contains data that I can't compare against any other tag (well not always, but mostly.)

To be clear, this works per album: each album has it's own ALBUMARTIST and/or it's own specified string.

Would this be possible to do? Thanks in advance!

---

<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: [February 15, 2012, 11:41pm UTC](https://community.mp3tag.de/t/filter-based-on-differing-artist-or-composer/13098/2 "2012-02-15T23:41:39Z")

</div>

1st:  
"$if($eql(%artist%,%composer%),yes,no)" IS no

2nd:  
"$if($eql(_specified string_,%composer%),yes,no)" IS no

---

<div class="post-metadata">

### Author: ![daanodinot](https://community.mp3tag.de/user_avatar/community.mp3tag.de/daanodinot/32/5252_2.png) [@daanodinot](https://community.mp3tag.de/u/daanodinot)
#### Post date: [February 24, 2012, 10:55pm UTC](https://community.mp3tag.de/t/filter-based-on-differing-artist-or-composer/13098/3 "2012-02-24T22:55:47Z")

</div>

Thanks, can I directly use these lines in an export configuration file (e.g. 003 txt tag backup) or should I add anything?

---

<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: [February 25, 2012, 8:15am UTC](https://community.mp3tag.de/t/filter-based-on-differing-artist-or-composer/13098/4 "2012-02-25T08:15:22Z")

</div>

> [@daanodinot](#):
>
> Thanks, can I directly use these lines in an export configuration file (e.g. 003 txt tag backup) or should I add anything?

No, you didn't mention "export" at all! And the name of the topic asked for a "Filter". So I gave you a Mp3tag fitler expression. [https://docs.mp3tag.de/filter](https://docs.mp3tag.de/filter)

If you want to do an export, please tell us how it should look like. "e.g. 003 txt tag backup" doesn't help in any way. I have no idea what you mean with your _specified string_, maybe you should give some examples.

For a export list of all files where ALBUMARTIST and ARTIST are different:  
$loop(%\_path%)$if($eql(%artist%,%albumartist%),,%\_path%  
)$loopend()

A list of all albums where ALBUMARTIST and ARTIST are different:  
$loop(%albumartist% %album%,1)$if($eql(%artist%,%albumartist%),,%albumartist% - %album%  
)$loopend()

All tracks that have a COMPOSER tag that differs from a _specified string:_  
$loop(%\_path%)$if($eql(%composer%,_specified string_),,%\_path%  
)$loopend()

All albums that have a COMPOSER tag that differs from a _specified string_:  
$loop(%albumartist% %album%,1)$if($eql(%composer%,_specified string_),,%albumartist% - %album%  
)$loopend()

---

<div class="post-metadata">

### Author: ![daanodinot](https://community.mp3tag.de/user_avatar/community.mp3tag.de/daanodinot/32/5252_2.png) [@daanodinot](https://community.mp3tag.de/u/daanodinot)
#### Post date: [February 26, 2012, 12:19pm UTC](https://community.mp3tag.de/t/filter-based-on-differing-artist-or-composer/13098/5 "2012-02-26T12:19:12Z")

</div>

> [@](#):
>
> No, you didn't mention "export" at all! And the name of the topic asked for a "Filter". So I gave you a Mp3tag fitler expression. [https://docs.mp3tag.de/filter](https://docs.mp3tag.de/filter)

You're right, I only mentioned "Filter", but just to try to explain my goal. I had no idea that there's an _actual_ Filter function present in Mp3tag (I know, I know...). I've tested both Export and Filter with your expressions and they work very well. I think I'm going to use Filter for the most part and perhaps the Export function in some cases. In short, your explanation and expressions are exactly what I needed... problem solved! 🙂

---

<div class="post-metadata">

### Author: ![daanodinot](https://community.mp3tag.de/user_avatar/community.mp3tag.de/daanodinot/32/5252_2.png) [@daanodinot](https://community.mp3tag.de/u/daanodinot)
#### Post date: [February 27, 2012, 1:07pm UTC](https://community.mp3tag.de/t/filter-based-on-differing-artist-or-composer/13098/6 "2012-02-27T13:07:42Z")

</div>

In the meanwhile, I've run into several issues... I thought I'd just continue this thread, since the issues are only related to filter expressions.

1. I'd like to check if some tags exist that aren't supposed to be there. For example, if want all files to contain only the %title% and %track% tag, any file must be listed that has a tag other than these two tags.
2. I'd like to check if there's any tag missing. In the previous example: any file missing either %title or %track% must be listed. I've actually already done this, but with a lot of repetition, e.g.: %title% MISSING OR %track% MISSING OR... etc. I hope this can be done in a better way.
3. It seems that the double-quote can only be used to delimit a string. I'm wondering how I can use it as a literal character (in a regular expression). " doesn't work...

Of course, if I run into more issues, I'll let you know.

---

<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: [February 27, 2012, 1:40pm UTC](https://community.mp3tag.de/t/filter-based-on-differing-artist-or-composer/13098/7 "2012-02-27T13:40:39Z")

</div>

1. 

NOT "$regexp($list(, \<\<\<,\>\>\>),\<\<\<.+?\>\>\>,)" IS "TITLE TRACK "

1. 

no better way as the one you are suggesting

1. 

As far as I know there is no way to esacape **"** in the filter.

---

<div class="post-metadata">

### Author: ![daanodinot](https://community.mp3tag.de/user_avatar/community.mp3tag.de/daanodinot/32/5252_2.png) [@daanodinot](https://community.mp3tag.de/u/daanodinot)
#### Post date: [March 4, 2012, 10:15am UTC](https://community.mp3tag.de/t/filter-based-on-differing-artist-or-composer/13098/8 "2012-03-04T10:15:17Z")

</div>

Thanks very much! Could you explain your first answer? I've no idea what's going on there 😲

---

<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: [March 4, 2012, 10:42am UTC](https://community.mp3tag.de/t/filter-based-on-differing-artist-or-composer/13098/9 "2012-03-04T10:42:53Z")

</div>

It's a filter expression again, as you probably have guessed yourself.

$list() is a undocumented function in Mp3tag. I have no idea why it isn't mentioned in the help files. Here is a very good explanation from DetlevD:  
[Lyrics aus Datei importieren?](https://community.mp3tag.de/t/6888/9)

The $regexp() function around it deletes tge values of the fields and the \<\<\< \>\>\> seperator and leaves only the blank field names wihth a single space after each name.

Use the Tag-Filename Converter if you want to see a preview of the functions (do not press OK):

$list(, \<\<\<,\>\>\>)  
$regexp($list(, \<\<\<,\>\>\>),\<\<\<.+?\>\>\>,)

---

<div class="post-metadata">

### Author: ![daanodinot](https://community.mp3tag.de/user_avatar/community.mp3tag.de/daanodinot/32/5252_2.png) [@daanodinot](https://community.mp3tag.de/u/daanodinot)
#### Post date: [March 5, 2012, 7:35am UTC](https://community.mp3tag.de/t/filter-based-on-differing-artist-or-composer/13098/10 "2012-03-05T07:35:51Z")

</div>

Thanks, it took me some time but I now fully get the expression 🙂

I noticed however the expression is not _quite_ what I mean. Let me try to formulate the problem a bit better:

Say, I've come up with a selection of 15 tags. All files are fine _except_ any file that has one or more tags that it is not in the predefined selection of tags. In other words, all files that only contain a _combination_ of the tags in selection are fine. The reason I say 'combination' is because some tags (title, track) obligatory and others (EAN, Publisher) optional.

At first I thought that replacing the string (on the right side of the equation) by a regular expression could solve my problem. Unfortunately it seems that the specific order of the tags almost differs per album:

COMPOSER Title ALBUM ALBUMARTIST Artist...  
Title ALBUM ALBUMARTIST Artist COMPOSER... etc.

That means using an IS expression becomes very difficult unless I have a consistent order. Expressions like HAS and MATCHES don't have this problem but they make it very difficult to recognize if there's some unknown string present.

Any idea?

---

<div class="post-metadata">

### Author: ![daanodinot](https://community.mp3tag.de/user_avatar/community.mp3tag.de/daanodinot/32/5252_2.png) [@daanodinot](https://community.mp3tag.de/u/daanodinot)
#### Post date: [March 6, 2012, 7:32am UTC](https://community.mp3tag.de/t/filter-based-on-differing-artist-or-composer/13098/11 "2012-03-06T07:32:10Z")

</div>

I found an interesting [thread](https://community.mp3tag.de/t/11210/3) on this issue. It seems I have to create a giant action group to make sure the order is the same... or I have to come up with something that works well despite the order.

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [March 6, 2012, 7:57am UTC](https://community.mp3tag.de/t/filter-based-on-differing-artist-or-composer/13098/12 "2012-03-06T07:57:22Z")

</div>

I hope this works:

NOT "$regexp($regexp($list(~,\<\<\<,\>\>\>),\<\<\<.+?\>\>\>,~),'~( **album|composer|title|track** )~',,1)" IS ""

Insert list of tag fields in the bold part.

---

<div class="post-metadata">

### Author: ![daanodinot](https://community.mp3tag.de/user_avatar/community.mp3tag.de/daanodinot/32/5252_2.png) [@daanodinot](https://community.mp3tag.de/u/daanodinot)
#### Post date: [March 6, 2012, 12:32pm UTC](https://community.mp3tag.de/t/filter-based-on-differing-artist-or-composer/13098/13 "2012-03-06T12:32:21Z")

</div>

Of course! It totally works 🙂

---

<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: [March 6, 2012, 3:17pm UTC](https://community.mp3tag.de/t/filter-based-on-differing-artist-or-composer/13098/14 "2012-03-06T15:17:46Z")

</div>

> [@daanodinot](#):
>
> Of course! It totally works 🙂

There was also the chance to find this ...  
[How to filter files with more than "basic" set of tags?](https://community.mp3tag.de/t/13021/5)

DD.20120306.1717.CET

---

<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/filter-based-on-differing-artist-or-composer/13098/15 "2026-02-09T12:23:40Z")

</div>


