Title tag from filename - Title {artist}

Sorry if this has been asked before:

I have filenames in the following format:

01 - Hawkwind - PXR5.flac

Currenltly I have just the song title as the title tag, so in the above case: "PXR5"

I want the title tag to be the title of the song, followed by the artist name from the filename. (the artists tag is currently just 'Various Artists").

So the title tag ends up being "PXR5 {Hawkwind}"

How can I do this?

The best way would be to get also the artist and track data into the tag fields.
"Various Artists" is best saved in ALBUMARTIST.
So, for all the files that should get a new name, do as follows
Copy the ARTIST to ALBUMARTIST, with Convert>Tag-Tag for ALBUMARTIST
Format string: %artist%
Import the data from the filename with Convert>Filename-Tag
Mask: %track% - %artist% - %title%

Write a new filename with Convert>Tag-Filename
Format string: %track% - %title% (%artist%)

And just to get this clear: the filename is the filename and not

I am not sure whether I got the brackets right as you use different ones in the thread title than in post.

Thanks for this.

The reason I need to change the 'artist' tag to Various Artists is because of the way my media library program works (Media Monkey). If I don't do this, I get all the individual artists (from compilations) listed in my 'artists' view. I don't want this!

Hence, I'd rather change the Artist tag to VA, but have the artist name in the 'title' tag.

In this particular case, I found it easier to just re-instate the original tags (via musicbrainz), then follow a 2-step process:

  1. Quick actions > Format > Title > %title% {%artist%}
  2. select all files and change 'artist' tag to Various Artists.

However, my real question was how to 'extract' the artist name from the filename and append it to the 'title' tag.

Still almost the same answer: create an amorphous string of the filename from structured data in the tag fields.
If you do not like to see the artist in the ARTIST field, then save the artist's name in a user-defined one and go on from there as described.
If the player does not meet your requirements and needs a non-standard way, then I would think about the use of a different player.
The non-standard way is to put the artist into title and use ARTIST for the ALBUMARTIST: But that is up to you.

Forgive my ignorance, but consider the following filename:

"01 - Ozric Tentacles - The Domes of G'bal"

Surely, there's a method of pattern matching where '-' is the separator and the 'fields' are whatever is between the separators?

Provided the convention is "track no." - "artist' - "title", then surely it is possible to make the title tag = %title% {%artist%) ?

However, putting the above into 'filename > tag' doesn't work.

Yes. The esiest way would be to apply Convert>Filename - tag first with
Mask: %track% - %myartist% - %title%

and then either run an action of the type "Format value" or Convert>Tag-Tag for TITLE afterwards with:
Format string: %title% (%myartist%)

Ah, now I see...

Actually what seems to work is:

Convert > Filename - Tag, mask:
%track% %dummy% %artist% %dummy% %title%

-- otherwise it tries to include the dashes (I think they might be some kind of non-standard dashes in my particular case)

Then, as you say, I can do a 'format value' action to customize the 'title' field.

Many thanks :slight_smile:

Did you try your format string on
01 - Ozric Tentacles - The Domes of G'bal
This shows for me:
image

I would suggest to copy & paste your filename from Windows Explorer and see what kind of dashes you really find in your filename.

It looks like you're right... and even worse:

Oh dear, this isn't a good method at all!

This is the best advice. If your tags/filenames were downloads there is a very good chance these "dash" characters are one oif many alternate unicode characters that are available. Figure dash, Em dash, En dash for example are just three different ones off the top of my head. By using copy/paste from an example file you will be using the actual character that is in that group of files.

yup, so this works:

%track% - %artist% – %title%

notice the long dash between artist and title, which I copied via hitting F2 on the filename in mp3tag.

Best forget about the %dummy% -- can be useful in some places but not in this case!

:+1:
There are many more variants :exploding_head: