Prefix title with Composer LastName


As the subject line says, I wish to prefix the title of a track with the last name of the composer, eg:
Composer tag contains: "Bach, Johann Sebastian"
Title: Sonata No. 1 in E-flat major BWV 525

Title should read: Bach: Sonata No. 1 in E-flat major BWV 525

Note: ALL Composer tags of my classical music tracks are populated with this configuration without exception: LastName, First and other names. Hyphenated names: Rimsky-Korsakov, Nikolai. The single comma in the name is key to identifying the Lastname the precedes it.

I am trying to learn the subtleties of regular expression, but if anyone can help me with this I would be very grateful.
Many thanks

An action of the type "Format value" for TITLE
Format string: $regexp(%composer%,',.*',): %title%

Just a side note: You know that you can't copy this TITLE tag to rename your filename because of the - at least for windows - illegal character : (colon) after your composer name?

Thank you very much, Ohrenkino. Much appreciate it.

LyricsLover, thank for pointing it out! I'll just replace the colon with a hyphen in Ohrenkino's expression.

Thanks once again to both of you.

1 Like

If the whole business is about renaming files, then I would not temper with the tag fields but use a corresponding mask to create just the filename.
And if the task is to separate pieces of information that do not really belong together, then a separator would be useful that is usually not part of everyday writing.
The hyphen, unfortunately, is.
A good approximation is usually the underscore _.

Thankfully, this is not about remaining files (that's aleady accomplished) but about identifying the composer in track titles. Thanks all the same for clearing it up. It adds to my understanding.

Sorry, renaming files .. not remaining files :roll_eyes:

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