# Prefix title with Composer LastName

**URL:** <https://community.mp3tag.de/t/prefix-title-with-composer-lastname/51069>\
**Category:** Support\
**Created:** [December 8, 2020, 8:12am UTC](https://community.mp3tag.de/t/prefix-title-with-composer-lastname/51069 "2020-12-08T08:12:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Noteworthy](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/n/bc79bd/32.png) [@Noteworthy](https://community.mp3tag.de/u/Noteworthy)\
**Post date:** [December 8, 2020, 8:12am UTC](https://community.mp3tag.de/t/prefix-title-with-composer-lastname/51069/1 "2020-12-08T08:12:29Z")

</div>

Hello,

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

---

<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:** [December 8, 2020, 8:25am UTC](https://community.mp3tag.de/t/prefix-title-with-composer-lastname/51069/2 "2020-12-08T08:25:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)\
**Post date:** [December 8, 2020, 8:46am UTC](https://community.mp3tag.de/t/prefix-title-with-composer-lastname/51069/3 "2020-12-08T08:46:23Z")

</div>

> [@Noteworthy](#):
>
> Title should read: Bach: Sonata No. 1 in E-flat major BWV 525

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](https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions) : (colon) after your composer name?

---

<div class="post-metadata">

**Author:** ![Noteworthy](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/n/bc79bd/32.png) [@Noteworthy](https://community.mp3tag.de/u/Noteworthy)\
**Post date:** [December 8, 2020, 9:24am UTC](https://community.mp3tag.de/t/prefix-title-with-composer-lastname/51069/4 "2020-12-08T09:24:27Z")

</div>

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.

---

<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:** [December 8, 2020, 9:34am UTC](https://community.mp3tag.de/t/prefix-title-with-composer-lastname/51069/5 "2020-12-08T09:34:39Z")

</div>

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 `_`.

---

<div class="post-metadata">

**Author:** ![Noteworthy](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/n/bc79bd/32.png) [@Noteworthy](https://community.mp3tag.de/u/Noteworthy)\
**Post date:** [December 8, 2020, 9:59am UTC](https://community.mp3tag.de/t/prefix-title-with-composer-lastname/51069/6 "2020-12-08T09:59:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Noteworthy](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/n/bc79bd/32.png) [@Noteworthy](https://community.mp3tag.de/u/Noteworthy)\
**Post date:** [December 8, 2020, 10:01am UTC](https://community.mp3tag.de/t/prefix-title-with-composer-lastname/51069/7 "2020-12-08T10:01:41Z")

</div>

Sorry, renaming files .. not remaining files 🙄

---

<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:** [January 7, 2021, 10:01am UTC](https://community.mp3tag.de/t/prefix-title-with-composer-lastname/51069/8 "2021-01-07T10:01:45Z")

</div>

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