Adding Bpm Right After "- " character

I got folder that contains music that usually is the same bpm
I want them to be added in my Folder title but not in the end nor the begining
The folder is currently Named like this :
Bam Bam Riddim - (1992) [Top Rank - Part 1]

I want to end up like this:
Bam Bam Riddim - 91bpm (1992) [Top Rank - Part 1]

Because i also have other folder with Just the Year after the "- " or only the producer in between the

Ive asked Chat GPT and it cam up with this script that i added in Action/Format Tag Field/_DIRECTORY
$regexp(%_folderpath%,^(.+?) - (\(\d+\)) \[(.+)\]$, $1 - $2 [$3 BPM])

This did not work can yall help me ?

Why you don't ask ChatGPT if he/she/it can explain why the solution is not working for you? :wink: :innocent:

Maybe.
First let us know, where exactly the BPM value is stored in your folder name.
Bam Bam Riddim - (1992) [Top Rank - Part 1]

You have to provide the BPM value (91 in your example) either in the folder name, the filename or in a tag inside your tracks. Every Action needs to have a source for this value (91) to write it at the desired position in your folder name.

Try
Format string: $regexp(%_directory%,(.*?) - (.*),$1 %bpm%bpm $2)

The mp3s inside the folder contains the 91 bpm in my example and i did ask Chat GPT and got me a Terminal Script instead which didnt work either
Kinda sad to see a machine cant tell me how the machine works

We are very close @ohrenkino
The only thing wrong is that it erased my separator " - "
But heres the result :

Then use
Format string: $regexp(%_directory%,(.*?) - (.*),$1 - %bpm%bpm $2)

Please be aware that your folder will be divided in several different folders as soon as NOT all your mp3 in the folder contains the exactly same BPM value.

Thanks you saved me from an excruciating headache

This is only true if you modify the filename.
If you set the _DIRECTORY, then the last file in the folder wins in setting the BPMs.

Thanks so i will select only one file from each folder

You could filter for the first file with
"$num(%track%,1)" IS 1

That would still not guarantee that the files inside the 91bmp-folder really contains only tracks with 91 in the BPM tag, right?

Yes to me its really just a quick guideline it has not have to be black n white
Its just with old Reggae Dancehall music - it got digitalized from vinyl
So sometime from the same "Riddim" you have different slightly bpms

Yes, you are right. As I said: the last one wins. And that could have any value in BPM.
Taking now only the first file in a folder does not make it any better as that choice does not mean that the ignored rest features the same BPMs.
I just had a look at an arbitrary folder and that had files ranging from 85 to 145 BPM - and only 2 had the same. That is why I have not added that info to the folder name.