# How to grab all text till the dash

**URL:** https://community.mp3tag.de/t/how-to-grab-all-text-till-the-dash/16566
**Category:** General Discussion
**Created:** [February 4, 2015, 12:54pm UTC](https://community.mp3tag.de/t/how-to-grab-all-text-till-the-dash/16566 "2015-02-04T12:54:15Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mirage0101](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/dc4da7/32.png) [@mirage0101](https://community.mp3tag.de/u/mirage0101)
#### Post date: [February 4, 2015, 12:54pm UTC](https://community.mp3tag.de/t/how-to-grab-all-text-till-the-dash/16566/1 "2015-02-04T12:54:15Z")

</div>

Hi I have been looking for a way to grab the title and put it in the artist tag, while cutting it off till the dash.

So:  
Title:  
Aerosmith - Hole in my soul

Would convert to:  
Artist:  
Aerosmith

I know I can use: convert / tag to tag.

Then I wanted to use format string:

$left(%title%,$find("-",%title%)-1)

(which would mean, grab all characters left from tag title, until the dash). At least that would it mean in excel. Any idea how I can achieve this in MP3tag?

tnx

---

<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 4, 2015, 1:22pm UTC](https://community.mp3tag.de/t/how-to-grab-all-text-till-the-dash/16566/2 "2015-02-04T13:22:03Z")

</div>

> [@mirage0101](#):
>
> ... I wanted to use format string:  
> $left(%title%,$find("-",%title%)-1)  
> (which would mean, grab all characters left from tag title, until the dash). At least that would it mean in excel. Any idea how I can achieve this in MP3tag? tnx

**ARTIST \<== $left(%TITLE%,$sub($strstr(%TITLE%,' -'),1))**

Because you know the Excel scripting language, so you should be able to understand the Mp3tag scripting language as well, see Mp3tag manual help pages.

DD.20150204.1521.CET

---

<div class="post-metadata">

### Author: ![mirage0101](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/dc4da7/32.png) [@mirage0101](https://community.mp3tag.de/u/mirage0101)
#### Post date: [February 4, 2015, 1:33pm UTC](https://community.mp3tag.de/t/how-to-grab-all-text-till-the-dash/16566/3 "2015-02-04T13:33:27Z")

</div>

> [@DetlevD](#):
>
> **$left(%TITLE%,$sub($strstr(%TITLE%,' -'),1))**
> 
> Because you know the Excel scripting language, so you should be able to understand the Mp3tag scripting language as well, see Mp3tag manual help pages.
> 
> DD.20150204.1521.CET

You're right, I didn't have a look at the strstr MP3 tag function...

And of course using action group would have done it too, but I couldn't stand I wasn't able to fix it using the excel functions..

tnx

---

<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 4, 2015, 3:46pm UTC](https://community.mp3tag.de/t/how-to-grab-all-text-till-the-dash/16566/4 "2015-02-04T15:46:07Z")

</div>

> [@mirage0101](#):
>
> Hi I have been looking for a way to grab the title and put it in the artist tag, while cutting it off till the dash.
> 
> So:  
> Title:  
> Aerosmith - Hole in my soul
> 
> Would convert to:  
> Artist:  
> Aerosmith  
> ...

What about the good ole "Guess values" (import tag) action for TITLE?  
Guessing pattern: %artist% - %title%

---

<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 4, 2015, 4:30pm UTC](https://community.mp3tag.de/t/how-to-grab-all-text-till-the-dash/16566/5 "2015-02-04T16:30:01Z")

</div>

> [@ohrenkino](#):
>
> What about the good ole "Guess values" (import tag) action for TITLE? Guessing pattern: %artist% - %title%

Hmm, ... the OP's original wish was good for ...  
Action "Guess values"  
Guessing pattern: %artist% - %dummy%

DD.20150204.1829.CET
