"Filename - Tag" ICON


I would like to now is there is a way to use the "Filename - Tag", so it would automatically change all "_" characters from filename into "/" characters in the tag "title"?

I would also like to use the icon "Tag - Filename" other way around: that it would automatically change all "/" characters from "title" tag into "_" characters in the filename?

I think you have to run an action after you have imported the data into the fields.
Action of the type "Replace" for TITLE
Search: _
Replace: /

For the tag-filename conversion, you can envelop the filename-mask with the $validate() function
$validate(%track% - %title%,_)
which takes care of any illegal character.

Yes, I know this. I've already have a defined one in the actions groups

But that makes two additional clicks on another option- and I need to eliminate this, beacasue I'm going to do some major changes, which will sum up to hundreds if not thousands of additional click; and if I forget even once or miss something, that I will have an error

And aside that, this works only in one way: "Filename - Tag". Because if I run "Tag - Filename", all ":" and "/" signs are just left out and not put into filename [because you can't have signs like that in Windows OS]. And as I understand, this is where the "validate" comes into play [which you kindly suggest looking into]. But but that either doesn't apply to what I'm specifically looking for or I just don't understand that part of manual and don't see how to apply that information to practice. I've also looked for information at the http://help.mp3tag.de/options_format.html#replace with same result / conclusion

You can save the clicks if you create an action group that does the "extra steps" with one call.
The Convert>Filename-Tag function can be emulated by a "Guess value" (import tag field) action.
Yes, you are right, that a "replace" action does almost the same thing as a $validate() only that you don't have to keep track of the special characters.
And while the ordinary tag-filename conversion eliminates the illegal characters, you can use the $validate() to replace an illegal character with a substitute so that you can see where the illegal character was.

or coming back to your original question: no, there is no automatism.

Unfortunately, both the on-line manual and your explanations are understandable for me at some minimum level

I've managed to make a three step action group, which looks now like that

Format value "TITLE": %filename%
Replace "TITLE": ".." -> ':"
Replace "TITLE": "
" -> '/"

And with this I have emulated the "Filename - Tag", with an addition of automatic correction of ".." and "_" signs in the TITLE tag [and at the same time leaving them in filename]. That is an exact outcome which I was aiming for and with clicks limited to minimum. But to clarify:

1] What can I put in the "Filename - Tag" icon to make those exact same three things at once. Or is it just impossible?
2] What can I put in the "Tag - Filename" icon to make an opposite set of action . Or is it just impossible?

[And if it is possible indeed, by "what can I put" a mean "what is the exact expression I should"; bacause I've tried writing proper "$validate(something,blah,blah)" and it felt flat]

This is impossible. At least with the Convert>Filename-tag function. You would have to use the actions that you have created as this action assigns data from an amorphous string to structured fields. So the data has to be in the fields first before you can replace anything.

It would have been easier to tell you the

if you had told me the exact mask you use to create the filename.
Provided, you want to get the TITLE as filename but only with legal characters for a filename and an underscore _ for each illegal character then the mask for Convert>Filename-Tag would look like this:

Actually: there are more than just : and / to be avoided for filenames. ?*"<>|: are also illegal. So once you have transformed the title back and forth, you will not find any ilegal characters in the title any more and you will not be able to backtrack which of the illegal characters was originally in the title.

In short: the messing about with replacements is not necessary if you declare the tags as master data and the filenames are just something that the file system has to deal with. From then on, only take care about the data in the tags. The filenames are of minor importance then.

This is not the proper syntax ...

See Mp3tag Help Manual.
The function $validate(filename,to) replaces all invalid characters, regarding the creation of filepathnames, with one dedicated character, chosen by the user.
Some invalid characters are: /?*"<>|:
Example: $validate(%ARTIST%' - '%ALBUM%' - '%TRACK%' - '%TITLE%,'_')
Example: $validate(%ARTIST%' - '%ALBUM%' - '%TRACK%' - '%TITLE%,)


See also ...
[F] $validate() broken?
Character remapping during conversion?


The purpose of the converter "Filename - Tag" is ... to split the file name into parts using a mask, ...
and put the parts automagically into the corresponding tag-fields, which are defined by the given mask format string.

If you want to replace one or more characters in a string, ...
then use the action "Replace" resp. the function $replace(), ...
or use the advanced action "Replace using Regular Expression" resp. the function $regexp().

The functionality of the interactive converters can be replaced by action resp. action groups.

With the help of the converter "Tag - Filename" it is possible to rename the selected files, based on the embedded tag information.

If you want to replace one or more characters in a string, ...
then use the action "Replace" resp. the function $replace(), ...
or use the advanced action "Replace using Regular Expression" resp. the function $regexp().

Example using action "Format value" and function $replace() ...

_FILENAME <== $replace(%ARTIST%' - '%ALBUM%' - '$num(%TRACK%,2)' - '%TITLE%,'/','_')

Example for bijective mapping ...

_FILENAME <== $replace(%TAGFIELD%,'/','_',':.','...',':','..') TAGFIELD <== $replace(%_filename%,'_','/','...',':.','..',':')

DD.20150202.2027.CET, DD.20150203.1759.CET

So, for copying "filename" into "title" [with mandatory correction] I have to use groups, because whatever [because I didn't get the explanation the first 3 times I read it]

And to this previous solution of mine I've made and an error preventing improvement:

Format value "TITLE": %filename%
Replace "TITLE": ".." -> ":"
Replace "TITLE": ":." -> "..."
Replace "TITLE": "
" -> "/"


Is that what yo are asking? [For me, a mask is that thing from Photoshop]. I have only that in the "Tag - Filename" icon, which works by just omitting illegal characters. Which is not good enough

Yes, that's what I want, but not an underscore for every sign that is illegal for Windows, but an underscore for a specific illegal character

And that is why I am talking from the beginning about two characters
Because I use them as a two separate examples [cases, problems] and because I can't have underscores running all over filenames [because I won't be precise enough]

That is the problem in the long shot and with thousands of files: the backtracking

That is way I've choosed a long time ago to "translate" illegal characters into legal

If I have an "/" in TITLE, a always use "_" in filename
If I have an ":" in TITLE, a always use ".." in filename

So everytime I copy between filename and tag, I have a potential correction to make

Yes, filenames are mainly for system and tags are what really matters for concerned / serious users

But filenames are also the fail-secure: a sometimes used safety information. And that is why I came up with the translation system. And I have just to much of an empirical experience backing that up, to not to use it anymore

So now now I need to automate that system, to make it easier and more precise

As I understand, we have covered the "filename" ---) "title" way: I have to use groups [because whatever]

Now for the "title" ---) "filename" way: what do I put in "Tag - Filename"?; or will I also have to use groups? If I put


it only works for the "/" sign; which is what I want. But that doesn't deal wit the rest of my "translation system". And if I put something like






it just doesn't work

But you are almost there: you can add a number of pairs:

and so on. You may add further pairs for replacement.
Please note that a filename has a certain maximum length which is usually shorter than the maximum field lengths.
Also, if you want to have a decent backup storage for the tag data in the shape of a filename then you would have to add the contents of a couple of other fields to the filename and/or path.
This backup system will probably not work for lyrics.
So if you really want to keep a backup of the data then you may want to consider the Export functions which enable you to save data in a number of formats and which also can be imported again into the tags.

Yes, I was so close in guessing what the combination should be

I've created now a second group for "title ---) filename" because if I have to use one for "filename ---) title", I should also use for the other way around, so that I don't accidentally click the "Filename - Tag" icon [which can't be altered to my needs] by the force of habbit:

Format value "FILENAME": $replace(%title%,/,,?,§,:,..,?,%)

And with that I have even the "translation" of the question mark into a paragraph sign, which i didn't expect to work, beacause of the question mark that has to be in the format string near it's end. So, thank you ohrenkino and DetlevD for the guidance

And just for future needs [to archivize on-line this ready-to-use knowledge], I shall now put once again the first action group:

Format value "TITLE": %filename%
Replace "TITLE": "§" -> "?"
Replace "TITLE": "
" -> "/"
Replace "TITLE": ".." -> ":"
Replace "TITLE": ":." -> "..."

And as for the export options I only have one small question. Let's say I have 100 files and I export tags. If I new remove even only one file, won't it prevent me from importing the tags in the proper way [to the proper files]? I mean, if I delete file 50, then 51 becomes "50" [and automatically gets copy set of tags from 50 instead of 51]?

If each export data line within a CSV export text file, contains a field with the value from %_path%, then, while importing the CSV data, Mp3tag takes this path value as a link or reference to the existing file.
If there is no match, then Mp3tag displays a message, about the failing file.


I thought ths topic was over, but there is a problem with the " sign in title tag

If I use


it makes three first "translatons" correct, but the last one makes " sign into a single ' sign, instead of '' [double apostrophe]

And if I use


all I get as a filename is a


and not '' [double] or ''' [triple] apostrophe


In Mp3tag the single apostrophe is a special character, because it is the string delimiter.
If you want to see one single apostrophe, you have to write two single apostrophes,
... noted in the Mp3tag help manual.


Yes, that works

Just don't undestand why when 2 gives 1, the 3 don't give 2 but an error [and you have jump over it and go a step further to 4, to be given 2]. But that that doesn't matter

This is simple math ...
3 is the sum of 2 plus 1 ...
... this is an odd number and a syntax error regarding the rule for single apostrophe in Mp3tag.
4 is the sum of 2 plus 2 ...
... this is an even number and the correct syntax regarding the rule for single apostrophe in Mp3tag.
... so ...

'this is a string' ... but ... '' (two single apostrophes) ...

... this is not an empty string, but one single apostrophe.