conditional logic in FILENAME -> TAG

I mostly use MP3TAG to fix the ID3 fields in concert bootlegs. All too often I run across files with the song-title and comments in the filename, but empty in the ID3 tags.

Here are three examples:

01. When You're On Top.mp3 02. Three Marlenas (fast version).mp3 03. 6th Avenue Heartache [laid back version].mp3

Right now, I have multiple FILENAME -> TAG setups, and I have to sift through the files to select the right ones for the right operators.

I'm rather lazy, however, and would really like to set up some conditional logic in my FILENAME -> TAG rule that would gracefully handle multiple scenarios.

Some pseudo-code of what I'm looking for:

%track%. %title% IF_STRING_MATCH="(%string%)" THEN="(%comment%)" ELSEIF="[%string%]" THEN="[%comment%]"

Does anyone know how to do this?

Thanks in advance.

You can include a comparison in the converter e.g. like this:

$num(%track%,3) - $if($eql(%artist%,%composer%),%bpm%,%language%) _ %title%

Fill in the gaps.

Hmm, is this really possible to write a scripting language expession into the Formatstring edit field of the converter "Filename- Tag"?
Wouldn't it be better to use an action "Guess values" to solve the OP's request?


Well ... the preview shows a string that matches the expected outcome ... and even modifies it according to a modified expression.

What I still can't do is the if .. then ... else.
As I am always rather reluctant to trust my abilities to define matching patterns (usually there is an important exception to the rule), I prefer filters to limit the amount of treated files... like this I would eliminate nested conditions. But then again: if you filter you wouldn't need the if-conditions anyway.

Please check again ... the talk is of the converter "Filename - Tag [Alt]+[2]"

Yes, Mp3tag often offers different methods to reach the goal.
Hence I suggested to use the action "guess values".
In the "Source format" edit field one can apply a scripting expression, for example a $regexp function, to catch all three cases from post #1 at once, at least handle the cases with round and square brackets at once.


Apparently the dose of morning coffee had not yet reached its destination. You are right.