Do not write field to filename it field is empty

So I was hoping there is a way to do this ....

This is what I want Tag to Filename to do but ...

%artist% Feat %albumartist% - %title% (%remixer%) (%version%)

what needs to happen is IF %albumartist% is blank then do not ADD the word Feat

Is there a way to do this?

Try this: [Feat %albumartist%]

You can try this:

%artist%$if($grtr($len($trim(%albumartist%)),0), FEAT %albumartist%,) - %title% (%remixer%) (%version%)

This should accomplish what you seek. I'll break it down:

  • $trim(%albumartist%) - removes all leading and trailing spaces from what is in the field.
  • $len($trim(%albumartist%)) - gets the length of $trim(%albumartist%).
  • $grtr($len($trim(%albumartist%)),0) - checks to see whether or not the length of $len($trim(%albumartist%)) is greater than 0
  • $if($grtr($len($trim(%albumartist%)),0), FEAT %albumartist%,) - if $grtr($len($trim(%albumartist%)),0) is TRUE, then display FEAT %albumartist%, else display nothing

The whole complicated $if($grtr($len... expression is comprised in the square brackets which does exactly that:
write the string in brackets only if the referenced field is filled.
So @Romano got it as concise as possible.

Thanks for the suggestion; however, being too concise usually leaves room for error. I just happened to have a file with an empty space in the field when I tested it and it does not account for a field containing empty space(s). Using the brackets in that scenario would be incorrect. It's not "complicated", especially when it is broken down, it is "complete". A simple copy-paste with a little testing is all that's needed if you're brave enough.

To get this right: there are no empty fields in a tag. If there is no data in a field, then it is simply not written to the tag.
The test with the square brackets looks if the field is present at all and then acts accordingly.
MP3tag then does not evaluate what the contents of a field is - with the possible exception to avoid illegal characters while writing file names.
Or the other way round: MP3tag takes your user input seriously. If you have the idea to add a space character to a field and nothing else - fine. How should MP3tag guess that you do not like that data in a file name but it is OK in a field.
If the data is not OK in a field, perhaps you go through your collection an remove leading and trailing spaces - to me, removing those spaces only for the file name creation appears to be a sub-optimum approach.
To find files with leading or trailing spaces in a field, you may use a filter like
"$if($eql($len(%artist%),$len($trim(%artist%))),1,0)" IS "0"
which looks at the data in ARTIST. Feel free to test other fields.