# Need format string to get data in front of first //

**URL:** https://community.mp3tag.de/t/need-format-string-to-get-data-in-front-of-first/66377
**Category:** Support
**Created:** [October 29, 2024, 4:58pm UTC](https://community.mp3tag.de/t/need-format-string-to-get-data-in-front-of-first/66377 "2024-10-29T16:58:42Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Pigler](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/898d66/32.png) [@Pigler](https://community.mp3tag.de/u/Pigler)
#### Post date: [October 29, 2024, 4:58pm UTC](https://community.mp3tag.de/t/need-format-string-to-get-data-in-front-of-first/66377/1 "2024-10-29T16:58:42Z")

</div>

I already tried my \*\*\* off.

I want a format string that:

- if there is no " // " just copy everything in the tag "Artist" to "Album Artist"

- if there is " // " just copy everthing before the first " // " from "Artist" to "Album Artist"

I already tried this but if there is no " // " it leaves "Album Artist" blank:

$if($strstr(%artist%, '// '), $left(%artist%, $sub($strstr(%artist%, '// '), 1)), %artist%)

---

<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: [October 29, 2024, 5:00pm UTC](https://community.mp3tag.de/t/need-format-string-to-get-data-in-front-of-first/66377/2 "2024-10-29T17:00:46Z")

</div>

> [@Pigler](#):
>
> if there is " // "

Are you sure that it is `//` and not `\\`?

---

<div class="post-metadata">

### Author: ![Pigler](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/898d66/32.png) [@Pigler](https://community.mp3tag.de/u/Pigler)
#### Post date: [October 29, 2024, 5:01pm UTC](https://community.mp3tag.de/t/need-format-string-to-get-data-in-front-of-first/66377/3 "2024-10-29T17:01:56Z")

</div>

![Screenshot 2024-10-29 180109](https://community.mp3tag.de/uploads/default/original/3X/4/a/4a85c2fb4573c366ae7731a098dda864e25b1213.png)

---

<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: [October 29, 2024, 5:41pm UTC](https://community.mp3tag.de/t/need-format-string-to-get-data-in-front-of-first/66377/4 "2024-10-29T17:41:08Z")

</div>

I was just asking as the `\\` indicate a multi-value field.  
But as the slashes are `//`  
Try an action of the type "Format value" or use Convert\>Tag-Tag for ALBUMARTIST  
Format string: `$regexp(%artist%,(.*?) //.*,$1)`

---

<div class="post-metadata">

### Author: ![Pigler](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/898d66/32.png) [@Pigler](https://community.mp3tag.de/u/Pigler)
#### Post date: [October 29, 2024, 5:59pm UTC](https://community.mp3tag.de/t/need-format-string-to-get-data-in-front-of-first/66377/5 "2024-10-29T17:59:35Z")

</div>

> [@ohrenkino](#):
>
> $regexp(%artist%,(._?) //._,$1)

Thank you that works exactly how i wanted to.

---

<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: [November 28, 2024, 5:59pm UTC](https://community.mp3tag.de/t/need-format-string-to-get-data-in-front-of-first/66377/6 "2024-11-28T17:59:51Z")

</div>

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