Tag to filename: copy right part of the title starting from the certain character

Hi all, I need some help please.
I want to make a filename out of the part of the TITLE tag.

Here is the title: Aphorisms: № 01. Recitative

What I would like is to make a filename named Recitative

I know how to do this work when I want to change part ot the same tag, eg. TITLE (replace with regular expressions -> field: TITLE ; regular expression: .* (with empty space after the asterisk because R from Recitative comes after empty space)) but I have no idea how to do it with tag to filename..

Do ALL of the titles for the files you want to rename share a common separator, like “ № 01. ” in your example? Or even something as simple as just the “. “ part?

If you have a screenshot of the list that would help.

Yes. Here is a list of all the titles:
Aphorisms: № 01. Recitative
Aphorisms: № 02. Serenade
Aphorisms: № 03. Nocturne
Aphorisms: № 04. Elegy
Aphorisms: № 05. Funeral March
Aphorisms: № 06. Etude
Aphorisms: № 07. Dance of Death
Aphorisms: № 08. Canon
Aphorisms: № 09. Legend
Aphorisms: № 10. Lullaby

I always have № and its number, following a period and empty space

I’ll have to play around with this for a bit. Generally it is easier to separate the filename into separate tags using the Action for Guess Values. But I don’t believe this works the other way, to format the filename. It may need two steps, but I’ll experiment and get back to you shortly.

Thank you so much, if you come up with something please tell me. Because I have many hundreds of files tagged like this and if I could automate the process it would save me lots of time.. :pray:

OK I think I found something that's working.
Actually the format of the file name should be "01 Recitative", "02 Serenade", etc. but since I can get those numbers at the front easily by typing %track% (those numbers are in 99% of cases same as the %track% numbers) I didn't bother mentioning. But now I found a function that I changed a bit and now its working almost perfectly without using %track%

$regexp(%title%,(.*) № (.*),$2)

The only problem is I get a dot after the number, so then I do a second step by goind to replace -> 'Field:' _FILENAME, 'Original:' . (dot) and 'Replace with' stays empty and now it shows good!

So sorry I didn't mention there should be numbers first. For me this is working, but if you or anyone else knows some other more elegant solution please post it, as I'd much rather use 1 step solution instead of 2 steps :innocent:

I was going to suggest the Action to “Guess Values.” But it seems this Action does not apply for the %_filename% field. This information field is one of the few that mp3tag can usually edit, but seems not with this Action.

What about: Convert>Filename-Tag
String: %dummy%. %title%

So it's a completey different pattern than in the original post?!
To get just a number and the trailing text, try:
$regexp('Aphorisms: № 01. Recitative',.*?(\d+)\. (.*),$1 $2)

Oh a one-step solution!

Thank you:+1: :+1:

The original request was to rename the filename, from the end part of the title tag. However it seems the reverse Tag>Filename converter doesn’t support the use of the %dummy% placeholder. I also could not get the Guess Values action to write to %_filename% either.

The best I could come up with was a temp field using Guess Values, then using that field in the template for Tag>Filename. The %track% field request later could have been added at this point.

But seems the regex solution in the following post is the more elegant way to go. Thanks for this @ohrenkino

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