# An action removing everything after a specific character

**URL:** https://community.mp3tag.de/t/an-action-removing-everything-after-a-specific-character/67275
**Category:** Support
**Created:** [January 25, 2025, 10:57am UTC](https://community.mp3tag.de/t/an-action-removing-everything-after-a-specific-character/67275 "2025-01-25T10:57:15Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Gat3pm](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/df705f/32.png) [@Gat3pm](https://community.mp3tag.de/u/Gat3pm)
#### Post date: [January 25, 2025, 10:57am UTC](https://community.mp3tag.de/t/an-action-removing-everything-after-a-specific-character/67275/1 "2025-01-25T10:57:15Z")

</div>

I am wanting to turn things like this:

Motley Crue: Theater Of Pain (1985)

Into this:

Motley Crue

Again have been racking my brain for hours. Need to eliminate the headache.

---

<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: [January 25, 2025, 10:59am UTC](https://community.mp3tag.de/t/an-action-removing-everything-after-a-specific-character/67275/2 "2025-01-25T10:59:32Z")

</div>

The : (colon) is the unique dividing character?  
In which field do you want to remove the right part after the colon?  
In the filename? In the TITLE?

Again, you don't say which field it concerns, as you did [here](https://community.mp3tag.de/t/remove-a-an-and-the/67274).

---

<div class="post-metadata">

### Author: ![Gat3pm](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/df705f/32.png) [@Gat3pm](https://community.mp3tag.de/u/Gat3pm)
#### Post date: [January 25, 2025, 11:10am UTC](https://community.mp3tag.de/t/an-action-removing-everything-after-a-specific-character/67275/3 "2025-01-25T11:10:50Z")

</div>

Sorry about not mentioning the FIELD's. I want to take information from Filename and put in artist or comments FIELD haven't decided yet. I am new to the community.

---

<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: [January 25, 2025, 11:11am UTC](https://community.mp3tag.de/t/an-action-removing-everything-after-a-specific-character/67275/4 "2025-01-25T11:11:50Z")

</div>

The filename never contains a colon (it's an invalid character in the Windows file system).

Please show us real example filenames and what you want to separate in which tag.  
You can add [screenshots](https://community.mp3tag.de/t/hints-for-asking-support-requests/56190#use-screenshots-to-exemplify-the-issue-2) in your questions or answers to better illustrate your current situation (Windows File Explorer?)

You can find the general description how to import parts of file- and folder names here:

> **[Import Tags from File and Folder Names – Mp3tag Documentation](https://docs.mp3tag.de/converters/import-tags-from-filenames/)**
>
> Documentation on Filename to Tag, a converter to import tags from file and folder names. Mp3tag is the universal Tag Editor.

---

<div class="post-metadata">

### Author: ![Gat3pm](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/df705f/32.png) [@Gat3pm](https://community.mp3tag.de/u/Gat3pm)
#### Post date: [January 25, 2025, 11:51am UTC](https://community.mp3tag.de/t/an-action-removing-everything-after-a-specific-character/67275/5 "2025-01-25T11:51:02Z")

</div>

I meant ARTIST FIELD, my brain is mush right now. I understand how to move information from one field to another. It's the manipulation of the information I am moving I struggle with. But yeah exactly, I want to remove the colon and everything after it. Hope this makes sense. Need to go to bed. Thank you for the help,

---

<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: [January 25, 2025, 12:00pm UTC](https://community.mp3tag.de/t/an-action-removing-everything-after-a-specific-character/67275/6 "2025-01-25T12:00:48Z")

</div>

> [@Gat3pm](#):
>
> Motley Crue: Theater Of Pain (1985)

I suggest to start with Convert Tag -\> Tag and the field you want to modify. This way you can immediately see the result of your change.

If you want to remove everything after a colon in the field ARTIST, it would look like this:  
Field:  
`ARTIST`  
Format string:  
`$regexp(%ARTIST%,(.*): (.*),$1)`

 ![image](https://community.mp3tag.de/uploads/default/original/3X/2/a/2ac24d02c8f6fb8cd02bc2a41a70fc02bced8aa5.png)

If you are sure that you really want to remove (forever!) the colon and the addition after the colon, you could also create an Action "Replace with regular expression" with  
Field:  
`ARTIST`  
Regular expression  
`(.*): (.*)`  
Replace matches with:  
`$1`

 ![image](https://community.mp3tag.de/uploads/default/original/3X/6/1/61d0bebdb46c0b7afca9acd4bb08579d424bc3a0.png)

**Hint:**  
This regular expressions works for your example with ONE colon.  
If your field would contain several colons like in  
`Motley Crue: Theater Of Pain (1985): and other dramas`  
it would result in  
`Motley Crue: Theater Of Pain (1985)`  
because the regular expression is matching the left part until the last colon.

The following alternative from @ohrenkino would select the left part until the first colon.

This is just to clarify that it is crucial to give examples and variants that are as precise as possible.

---

<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: [January 25, 2025, 12:03pm UTC](https://community.mp3tag.de/t/an-action-removing-everything-after-a-specific-character/67275/7 "2025-01-25T12:03:50Z")

</div>

> [@Gat3pm](#):
>
> ARTIST FIELD ... I want to remove the colon and everything after it.

As an alternative: Use an action of the type "Guess value"  
Source format: `%artist%`  
Guessing pattern: `%artist%: %dummy%`

---

<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 24, 2025, 12:04pm UTC](https://community.mp3tag.de/t/an-action-removing-everything-after-a-specific-character/67275/8 "2025-02-24T12:04:36Z")

</div>

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