# Remove Key and BPM from end of Title

**URL:** <https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624>\
**Category:** Support\
**Created:** [March 7, 2022, 5:59pm UTC](https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624 "2022-03-07T17:59:49Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasonboudinot](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jasonboudinot/32/11242_2.png) [@jasonboudinot](https://community.mp3tag.de/u/jasonboudinot)\
**Post date:** [March 7, 2022, 5:59pm UTC](https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624/1 "2022-03-07T17:59:49Z")

</div>

My title reads "I Go To Work [DJ Johnny Flores Edit] 4A 126". I would like to remove the "4A 126" (Key and BPM). I realize I could remove last 6 spaces from the end, but some of my files may be only 5 spaces. Also, how would I filter my files for this? Thanks In Advance.

---

<div class="post-metadata">

**Author:** ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)\
**Post date:** [March 7, 2022, 6:03pm UTC](https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624/2 "2022-03-07T18:03:24Z")

</div>

Can you clarify if ALL of your titles have items in square brackets like `[DJ Johnny Flores Edit]`? And ALL titles do have a key and BPM on the end?

---

<div class="post-metadata">

**Author:** ![jasonboudinot](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jasonboudinot/32/11242_2.png) [@jasonboudinot](https://community.mp3tag.de/u/jasonboudinot)\
**Post date:** [March 7, 2022, 6:07pm UTC](https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624/3 "2022-03-07T18:07:24Z")

</div>

All my files do not have the brackets or the Key and Bpm in the title.

---

<div class="post-metadata">

**Author:** ![jasonboudinot](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jasonboudinot/32/11242_2.png) [@jasonboudinot](https://community.mp3tag.de/u/jasonboudinot)\
**Post date:** [March 7, 2022, 6:15pm UTC](https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624/4 "2022-03-07T18:15:01Z")

</div>

All of the Key and BPM is at the end of the title, but the key and bpm is not in every title.

---

<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 7, 2022, 6:16pm UTC](https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624/5 "2022-03-07T18:16:45Z")

</div>

You could try:  
`$regexp(%title%,(.*)\d. \d+,$1)`

In the converter\>Tag-Tag or an action of the type "Format value" for TITLE

---

<div class="post-metadata">

**Author:** ![jasonboudinot](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jasonboudinot/32/11242_2.png) [@jasonboudinot](https://community.mp3tag.de/u/jasonboudinot)\
**Post date:** [March 7, 2022, 6:19pm UTC](https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624/6 "2022-03-07T18:19:06Z")

</div>

> [@ohrenkino](#):
>
> $regexp(%title%,(.\*)\d. \d+,$1)

Perfect! How would I filter these files?

---

<div class="post-metadata">

**Author:** ![jasonboudinot](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jasonboudinot/32/11242_2.png) [@jasonboudinot](https://community.mp3tag.de/u/jasonboudinot)\
**Post date:** [March 7, 2022, 6:20pm UTC](https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624/7 "2022-03-07T18:20:58Z")

</div>

Actually, It will only delete these values if they exist correct?

---

<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 7, 2022, 6:23pm UTC](https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624/8 "2022-03-07T18:23:22Z")

</div>

yes. only if there is a hit - otherwise the complete data from the field is the result.

Yet, if you want to filter, then applying the action only to filtered files will reduce the amount of files with a modified date - MP3tag opens and closes all files even though nothing may be changed.

`%title% MATCHES ".*\d. \d+"`

---

<div class="post-metadata">

**Author:** ![jasonboudinot](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jasonboudinot/32/11242_2.png) [@jasonboudinot](https://community.mp3tag.de/u/jasonboudinot)\
**Post date:** [March 7, 2022, 6:24pm UTC](https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624/9 "2022-03-07T18:24:40Z")

</div>

> [@ohrenkino](#):
>
> %title% MATCHES ".\*\d. \d+"

Wow. I'm about a week new to this, but ive learned so much in the last week. Thanks!

---

<div class="post-metadata">

**Author:** ![jasonboudinot](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jasonboudinot/32/11242_2.png) [@jasonboudinot](https://community.mp3tag.de/u/jasonboudinot)\
**Post date:** [March 7, 2022, 7:16pm UTC](https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624/10 "2022-03-07T19:16:10Z")

</div>

Ok, I had some files with "10A 126" vs "4A 126". So now I have files with a trailing "1". I have searched to find a way to filter these with no luck.

once filtered I would use

**Field:** Title  
**Regular expression:** ^.{2}$ to remove 2 charachters chars.  
**Replace matches with:**

---

<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 7, 2022, 7:19pm UTC](https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624/11 "2022-03-07T19:19:31Z")

</div>

Try this filter:  
`%title% MATCHES "1$"`

---

<div class="post-metadata">

**Author:** ![jasonboudinot](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jasonboudinot/32/11242_2.png) [@jasonboudinot](https://community.mp3tag.de/u/jasonboudinot)\
**Post date:** [March 7, 2022, 7:21pm UTC](https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624/12 "2022-03-07T19:21:25Z")

</div>

> [@ohrenkino](#):
>
> %title% MATCHES "1$"

Perfect again! Thanks

---

<div class="post-metadata">

**Author:** ![jasonboudinot](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jasonboudinot/32/11242_2.png) [@jasonboudinot](https://community.mp3tag.de/u/jasonboudinot)\
**Post date:** [March 7, 2022, 8:51pm UTC](https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624/13 "2022-03-07T20:51:17Z")

</div>

Ok you have been a great help. I have "title - 120", "title - 90", "title 90", "title -7A - 120". How can I filter these and then remove everything but the title?

---

<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 7, 2022, 9:00pm UTC](https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624/14 "2022-03-07T21:00:20Z")

</div>

Looks like you alsways have a number at the end.  
The filter would be:  
`%title% MATCHES "\d+$"`

The title looks like everything following the hyphen should be deleted:  
`$regexp(%title%,'(.*?) -.*',$1)`

---

<div class="post-metadata">

**Author:** ![jasonboudinot](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jasonboudinot/32/11242_2.png) [@jasonboudinot](https://community.mp3tag.de/u/jasonboudinot)\
**Post date:** [March 7, 2022, 9:09pm UTC](https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624/15 "2022-03-07T21:09:13Z")

</div>

What if I have a space between title and number? Remove the Dash?

---

<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 7, 2022, 9:10pm UTC](https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624/16 "2022-03-07T21:10:49Z")

</div>

You can test the regular expression in Converter\>Tag-Tag.  
See, if it produces the correct result.

---

<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 6, 2022, 9:11pm UTC](https://community.mp3tag.de/t/remove-key-and-bpm-from-end-of-title/56624/17 "2022-04-06T21:11:38Z")

</div>

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