# If filename contains 'x', add 'y' to Album Artist field

**URL:** https://community.mp3tag.de/t/if-filename-contains-x-add-y-to-album-artist-field/64206
**Category:** Support
**Created:** [March 27, 2024, 1:21am UTC](https://community.mp3tag.de/t/if-filename-contains-x-add-y-to-album-artist-field/64206 "2024-03-27T01:21:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![RicFlair](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/0ea827/32.png) [@RicFlair](https://community.mp3tag.de/u/RicFlair)
#### Post date: [March 27, 2024, 1:21am UTC](https://community.mp3tag.de/t/if-filename-contains-x-add-y-to-album-artist-field/64206/1 "2024-03-27T01:21:55Z")

</div>

I simply want to to do the following IF statement (an 'Action' perhaps)

for example - IF a filename contains 'SC Karaoke', write 'Sound Choice Karaoke' to the Album Artist field.

I've tried to find this answer via Google and previous comments in the community without any luck, forgive me if I've missed this answer elsewhere.

pardon my ignorance, I appreciate your time.

---

<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: [March 27, 2024, 6:21am UTC](https://community.mp3tag.de/t/if-filename-contains-x-add-y-to-album-artist-field/64206/2 "2024-03-27T06:21:42Z")

</div>

Before you start with modifications, make sure you have a backup if anything goes wrong.  
If

> [@RicFlair](#):
>
> Sound Choice Karaoke

is the only string that you want to set, then a filter would be the quickest way.  
Use  
`%_filename% HAS "SC Karaoke"`  
and then enter the correct album artist in the tag panel.

The approach with the filter is also the fastest approach if you want to treat other strings as with an action you would have to create an action for each search string and data string.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [March 27, 2024, 7:19am UTC](https://community.mp3tag.de/t/if-filename-contains-x-add-y-to-album-artist-field/64206/3 "2024-03-27T07:19:41Z")

</div>

> [@RicFlair](#):
>
> for example - IF a filename contains 'SC Karaoke', write 'Sound Choice Karaoke' to the Album Artist field.

Another idea to **append**"Sound Choice Karaoke" to ALBUMARTIST:  
Create a new Action "Format Value":  
Field: ALBUMARTIST  
Formatstring:  
`$ifgreater($strstr(%_FILENAME%,'SC Karaoke'),0,%ALBUMARTIST%Sound Choice Karaoke,)`

If you want to **overwrite** the existing content in ALBUMARTIST (whatever it currently contains) with "Sound Choice Karaoke", then you could use  
`$ifgreater($strstr(%_FILENAME%,'SC Karaoke'),0,Sound Choice Karaoke,)`

Please be aware that you will loose the content of ALBUMARTIST with the second Format string.

_Hint:_  
`$strstr(x,y)` finds the first occurrence of string y in string x.  
If you would choose only 'SC' as search string, it would also match SCHNEE or any other word starting with SC.

Test this carefully with your existing filenames.

---

<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: [April 26, 2024, 7:19am UTC](https://community.mp3tag.de/t/if-filename-contains-x-add-y-to-album-artist-field/64206/4 "2024-04-26T07:19:59Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
