Pull Data from filename or Title tag and put in a new custom tag?

Hello, I'm checking out mp3Tag for this issue as I was using MusicBrainz Picard, but it is unable to solve this issue for me, so I hope that mp3Tag can.

Over the years, I have added lots of additional info to my mp3 tags/filenames. This includes: (Bonus Track), (Acoustic), (Studio Acoustic), (Live Acoustic), (Live), (Live DateOfShow), (Live LocationOfShow), (Live AlbumName), (Live AlbumInitials), (Demo), (Alt Version), different Remixes, and hundreds of other ones.

Using MusicBrainz Picard, they don't store most of that info. so If I run my files through it, I lose it. and the main issue is trying to find what song I want. For Example, I have 20 Versions of Kill 'Em All. by Metallica. so it allows me to find the studio version, The 2 Versions that were recorded here in My City, The Demo, The Edit, etc. in any media player.

So what I would like is a way to extract that extra info. ideally, it'll check the filename. then it'll check the title. and if it finds that data in either or separate data in both, it'll save them to a new tag: %ExtraSongInfo%

I was messing with the Filename to tag, and the Actions with Guess Format, and neither were very useful, since there is no real standard to my data, and there are quite a few. But also they could be like: Artists - Track - Song (Demo)
or: Artist_Track_Song_(Demo)
or: Track-Artist-Song(Demo)

and any other possibility you can think of.

So my guess would be to use RegEx to either have a master list it looks for. or even everything between ()'s ... also i'd like the (Bonus|Bonus Track) to goto the %BonusTrack% . the reason being so it can always go at the end of the title, where it should.

it's also worth noting that there could be several additional pieces of info in the filename or title tags. (Live) (Acoustic) ... as a rough example.

Anyhow, any help would be appreciated.

Thank you,

A regular expression expects some regularity ... :wink:
So, you have to create an extraction mechanism for each pattern.
Afterwards, you have standardized your data, then you can generate filenames that follow rules that can be taken apart by a regular expression.
Or guess values, e.g.
Artists - Track - Song (Demo)
Guessing pattern: %Artist% - %Track% - %title% (%extradata%)

Why are you so fixed on the filename?
All of these aditional informations are song-related, so to my opinion they should be in the title-tag too.
If they are, unregularities like these

don't matter.

Here is a proposal, which fetches the last extra info from the filename.
You may adapt it to your needs.

You have already described the way to the solution, and the function $regexp will help you. You can set up a list of special words and let $regexp check for matching. Action "Format value" Field: EXTRASONGINFO Formatstring: $if($eql($regexp(%_filename%, '^.*\((Bonus Track|Acoustic|Studio Acoustic|Live Acoustic|Live

|Live DateOfShow|Live LocationOfShow|Live AlbumName
|Live AlbumInitials|Demo|Alt Version)).*$

',),), $regexp(%_filename%, '^.*\((Bonus Track|Acoustic|Studio Acoustic|Live Acoustic|Live

|Live DateOfShow|Live LocationOfShow|Live AlbumName
|Live AlbumInitials|Demo|Alt Version)).*$

','$1'),) (all code into one line) If the list of special names get longer, then you might do something like this ... Action "Format value" Field: LIST_OF_EXTRASONGINFO Formatstring: 'Bonus Track|Acoustic|Studio Acoustic|Live Acoustic|Live|Live DateOfShow|Live

LocationOfShow|Live AlbumName|Live AlbumInitials|Demo|Alt Version

' ... or ... Action "Format value" Field: LIST_OF_EXTRASONGINFO Formatstring: 'Bonus Track|Demo|Alt Version' Action "Format value" Field: LIST_OF_EXTRASONGINFO Formatstring: %LIST_OF_EXTRASONGINFO%'|Acoustic|Studio Acoustic|Live Acoustic' Action "Format value" Field: LIST_OF_EXTRASONGINFO Formatstring: %LIST_OF_EXTRASONGINFO%'|Live|Live DateOfShow|Live LocationOfShow|Live AlbumName|Live AlbumInitials' Action "Format value" Field: EXTRASONGINFO Formatstring: $if($eql($regexp(%_filename%,'^.*\(('%LIST_OF_EXTRASONGINFO%')\).*$',),),
          <!--coloro:#800080--><span style="color:#800080"><!--/coloro-->$regexp<!--colorc--></span><!--/colorc--><!--coloro:#000000--><span style="color:#000000"><!--/coloro-->(<!--colorc--></span><!--/colorc--><!--coloro:#0000be--><span style="color:#0000be"><!--/coloro-->%_filename%<!--colorc--></span><!--/colorc--><!--coloro:#000000--><span style="color:#000000"><!--/coloro-->,<!--colorc--></span><!--/colorc--><!--coloro:#008080--><span style="color:#008080"><!--/coloro-->'<!--colorc--></span><!--/colorc--><!--coloro:#008080--><span style="color:#008080"><!--/coloro-->^.*\((<!--colorc--></span><!--/colorc--><!--coloro:#008080--><span style="color:#008080"><!--/coloro-->'<!--colorc--></span><!--/colorc--><!--coloro:#000000--><span style="color:#000000"><!--/coloro-->%LIST_OF_EXTRASONGINFO%<!--colorc--></span><!--/colorc--><!--coloro:#008080--><span style="color:#008080"><!--/coloro-->'<!--colorc--></span><!--/colorc--><!--coloro:#008080--><span style="color:#008080"><!--/coloro-->)\).*$<!--colorc--></span><!--/colorc--><!--coloro:#008080--><span style="color:#008080"><!--/coloro-->'<!--colorc--></span><!--/colorc--><!--coloro:#000000--><span style="color:#000000"><!--/coloro-->,<!--colorc--></span><!--/colorc--><!--coloro:#008080--><span style="color:#008080"><!--/coloro-->'<!--colorc--></span><!--/colorc--><!--coloro:#008080--><span style="color:#008080"><!--/coloro-->$1<!--colorc--></span><!--/colorc--><!--coloro:#008080--><span style="color:#008080"><!--/coloro-->'<!--colorc--></span><!--/colorc--><!--coloro:#000000--><span style="color:#000000"><!--/coloro-->)<!--colorc--></span><!--/colorc--><!--coloro:#000000--><span style="color:#000000"><!--/coloro-->,<!--colorc--></span><!--/colorc--><!--coloro:#000000--><span style="color:#000000"><!--/coloro-->)<!--colorc--></span><!--/colorc--></b><!--fontc--></span><!--/fontc--><!--sizec--></span><!--/sizec-->


I'm pretty sure the only standard I've kept over the years is putting that info in parentheses. So there's that at least.

The extra info could be in the filename, the tag, or different parts in both.
Those examples I typed up. Are to show any possible regex issues. And that additional info should be. But as explained with Musicbrainz. Most of that info isn't in they're database. And are custom tags I've made I just don't want to lose. So moving then to their own tag is the best option.

Hmm. I'll work wit that and see what I can do. I'm curious. It'll only pull the last result found? So (Live) (Acoustic) (Bonus Track) would only save (Bonus Track)?

Also does it support advanced regex checks? I have a check in FileBot for movies that checks for certain words like special, extended, limited, unrated and will match those if it's just those words. Then in the same regex line it checks for edition, cut, edit, etc and will match those with any of the previous words when they appear together. Something like that would help a lot here. Especially with cutting down the size of what to check for.

Though it might be easier to just look for and save everything in ()'s

Also the (Live DateOfShow) and (Live LocationOfShow) are different for Orth much every live album i have. (as well as thousands of bootlegs) So that could be an issue trying to add them to the list. Haha.

I'll also want it to Check the current title tag as well. For additional ones if they are different of course. But at least you've given me something to work with. So it's a start. Thank you.

There is another way ....

filename = Visa (Live Acoustic) (feat. Junior Reid) (Demo).mp3

This regexp removes all text, but not the parenthesis, which contain text from the LIST_OF_EXTRASONGINFO ... $regexp(%_filename%,'.*?(\(('%LIST_OF_EXTRASONGINFO%')?\)).*?','$1') $regexp(%_filename%,'.*?(\((Demo|Live Acoustic|Live LocationOfShow|Bonus Track)?\)).*?','$1') ==> '(Live Acoustic)(Demo)' $regexp(%_filename%,'.*?(\((Demo|Live Acoustic|Live LocationOfShow|Bonus Track)?\)).*?','$2~') ==> 'Live Acoustic~Demo~'


How to use a text file as input for following actions?

Step 1
Create new folder ... to hold private personal user defined data ...
for example ... a textfile with a list of EXTRASONGINFO items.

Open Windows explorer ...
type into the address line ...

There create new folder ...
(datap stands for "private or personal data" ... you may choose any other name)

Open folder "datap"...
There create new subfolder ...

... or in one go ...
Open DOS-Shell and create new folder ... by executing the following line ...
MD "%APPDATA%\Mp3tag\datap\SongInfo" &START "SongInfo" /B /MAX "%APPDATA%\Mp3tag\datap\SongInfo" &EXIT

... or in one go ...
Press [WindowsKey+R] and copy this string into the edit field ...
CMD.EXE /D/Q/C MD "%APPDATA%\Mp3tag\datap\SongInfo" &START "SongInfo" /B /MAX "%APPDATA%\Mp3tag\datap\SongInfo" &EXIT
... then execute this command.

... or ...
Work with another existing folder within your system.

Step 2
Create a text file.
In the new SongInfo data folder ...
there create a standard text file ...
name it ...
Fill this text file with a list of special names, one name per line.

Bonus Track
Studio Acoustic
Live Acoustic
Live DateOfShow
Live LocationOfShow
Live AlbumName
Live AlbumInitials
Alt Version

... and so on.

Step 3
Create a Mp3tag actions group.

If the file "ExtraSongInfo.txt" does not reside in the "...\Mp3tag\datap\SongInfo" folder, ...
then you have to adapt the filepath in the following group of actions ...

Action #1 : Import text-file Field : LIST_OF_EXTRASONGINFO Filename : $getEnv('MP3TAGAPPDATA')'\datap\SongInfo\ExtraSongInfo.txt' Action #2 : Format value Field : LIST_OF_EXTRASONGINFO Formatstring: $regexp($regexp(%LIST_OF_EXTRASONGINFO%,'\s*[\r\n]+\s*','|'),'\|$',)

Step 4
Apply the actiongroup from step 3 against the selected media files.

Step 5
The pipe separated list of extra song info items, within the tag-field "LIST_OF_EXTRASONGINFO", ...
is now ready to use within the previously selected media files ...
and can be removed later in the process.


Thanks, I didn't quit get it to work. but half way. i'll keep working on it. thank you for your help.