Is it possible to prepend part of the file name to the existing title tag?


#1

Hello, and thank you for the wonderful program! Just discovered it, and it's amazing! :slight_smile:

Is it possible to systematically prepend an excerpt of MP3 files' names to their existing title tag?

Here's the scenario: a bunch of MP3 files that include the English title as part of the file name, but have the Japanese-language title in the title tag proper. What I'd love to do, if possible, is to put the English title, extracted from the file name, in front of the Japanese title in each file's tag.

E.g., starting with:

File name: "Album Name TrackID - Song Title.MP3" Title Tag: the title in Japanese characters that I do not understand but want to keep

I'd love to change it to:

File name: "Album Name TrackID - Song Title.MP3" (i.e., unchanged) Title Tag: "Song Title, " + the title in Japanese characters that I do not understand but want to keep

So the song title tag will contain the extracted English title followed (say) by a comma, and space, and then the original Japanese title-tag text.

Is this possible?

Thanks for your help, and for the great program! :slight_smile:


#2

group these two actions in one action group.

Action #1
format: TITLE
value: %_filename%, %title%

Action #2
reg exp: TITLE
value: ^.+\s-\s(.+)
replace with: $1

Excuse me im on my fone so i have not had the chance to test it. But it should work okay. Test on a single file first.


#3

SteveHero,

I think I know why you deserve your name here--it worked perfectly! And was a great learning experience in using MP3TAG. (For the total newb, figuring out how in the world to use or create an action seems at first a total mystery, even with documentation.)

Thank you! With your help, 'twas easy!


#4

haha, its nothing to do with mp3tag. Its a producer/dj name i have :slight_smile:

Its learning what is the app is capable of then you really what to explore more of its features.

Btw to explain the reg exp i used, its function in case your interested is, once you have used the format to make the TITLE e.g.
%_filename%, %title%
Album Name TrackID - Song Title, the title in Japanese

I then wanted to get rid of everything up to and including the 1st '-' and the whitespace afterwards.

To do this I used the reg exp: ^.+\s-\s(.+)
^ anchors search string to beginning of text string. (this is usefull because lets say there was two ' - ' in your text string. Without the anchor it would grab the two of them. But with '^' it is now not possible.
. matches any character and '+' means find it as many times as possible.
\s matches a whitespace. (you could place a '+' after this as well in case there is a doudle whitespace.

  • matches '-' litrally.
    \s same as above.
    ( start capturing.
    . Same as above.
    ) end capturing.

Replace with: $1 (so bascially whatever was captured inside the brackets is returned with '$1')

IF there was a 2nd set of capturing brackets used in the reg exp then $2 would be used and so on...

ps. Dont be scared of reg exp. It only took me a day to get the hang of it (once i studied up on it) Get a program called 'reg exp buddy' (it will help your reg exp learning curve greatly) if your interested in reg exp. They save so much time in this program, its well worth it.

Glad to be of help Sarcophagus and welcome to the forum.