# Caputuring BPM from end of title

**URL:** <https://community.mp3tag.de/t/caputuring-bpm-from-end-of-title/61943>\
**Category:** Support\
**Created:** [August 27, 2023, 11:39pm UTC](https://community.mp3tag.de/t/caputuring-bpm-from-end-of-title/61943 "2023-08-27T23:39:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ianwat](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/7993a0/32.png) [@ianwat](https://community.mp3tag.de/u/ianwat)\
**Post date:** [August 27, 2023, 11:39pm UTC](https://community.mp3tag.de/t/caputuring-bpm-from-end-of-title/61943/1 "2023-08-27T23:39:14Z")

</div>

So apologies I have searched for this, but whilst there are a number of similar posts, none are quite the same.

So I have lots of files that are. Artist - Title BPM

So examples  
Goya Menór & Nektunez - Ameno Ampiano (You Wanna Bamba) (Remix - Mm Clean Edit) 113.mp3  
Shabba Ranks With Chevelle Franklin - Mr. Loverman (Album Version) 86.mp3  
Shaggy - Oh Carolina 125.mp3

This is quite common with songs purchased from DJ sources as it tells me what bpm the track was re-mastered in.

So I can grab the bpm from the title and populate it, and then re-title the songs. **(actually scratch that I can't as I have the same problem it's not working**

However, I'd really appreciate help understanding how to do this with regex.

So I need to capture only the last Space then [0-9]+`

But how do I make sure I don't grab anthing from the beginning in case the artist is something like heaven 17 ?

Many thanks.

---

<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:** [August 28, 2023, 5:48am UTC](https://community.mp3tag.de/t/caputuring-bpm-from-end-of-title/61943/2 "2023-08-28T05:48:59Z")

</div>

Try an action of the type "Format value" for BPM  
Format string: `$regexp(%_filename%,.*?(\d+)$,$1)`

---

<div class="post-metadata">

**Author:** ![ianwat](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/7993a0/32.png) [@ianwat](https://community.mp3tag.de/u/ianwat)\
**Post date:** [August 28, 2023, 8:41am UTC](https://community.mp3tag.de/t/caputuring-bpm-from-end-of-title/61943/3 "2023-08-28T08:41:27Z")

</div>

That works perfectly, many thanks.

Is there any way to then use that to remove it from the title or from the file name?

As I still end up with Champion 90 as the Title of the song, even though I've now got the BPM (and I re-reading my post, I apologise that this removal wasn't clearer)

Again many thanks for the assistance.

---

<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:** [August 28, 2023, 8:49am UTC](https://community.mp3tag.de/t/caputuring-bpm-from-end-of-title/61943/4 "2023-08-28T08:49:09Z")

</div>

> [@ianwat](#):
>
> title or ... the file name

The title isn't the filename.  
As MP3tag is a tagging program I would always manipulate the tag fields and finally, if at all, generate a filename with the tag data. Filenames have certain restrictions in respect to valid characters but these restrictions do not apply to the tag fields.

Coming back to the problem:  
To remove the trailing number after you have filled BPM:  
Try an action of the type "Replace with regular expression" for TITLE  
Search string: `(.*?) \d+$`  
Replace with: $1

---

<div class="post-metadata">

**Author:** ![ianwat](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/7993a0/32.png) [@ianwat](https://community.mp3tag.de/u/ianwat)\
**Post date:** [August 28, 2023, 8:56am UTC](https://community.mp3tag.de/t/caputuring-bpm-from-end-of-title/61943/5 "2023-08-28T08:56:35Z")

</div>

Aware the title isn't the file name, but was looking at it this way.

If I can remove from the filename, I can use format filename - tags.

If I can remove from the title, I can use tags - filename.

I will give your second action a go, many thanks.

---

<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:** [September 27, 2023, 8:56am UTC](https://community.mp3tag.de/t/caputuring-bpm-from-end-of-title/61943/6 "2023-09-27T08:56:48Z")

</div>

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