# "Filename - Tag" ICON

**URL:** https://community.mp3tag.de/t/filename-tag-icon/16549
**Category:** Support
**Created:** [January 31, 2015, 5:41pm UTC](https://community.mp3tag.de/t/filename-tag-icon/16549 "2015-01-31T17:41:52Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)
#### Post date: [February 3, 2015, 3:04pm UTC](https://community.mp3tag.de/t/filename-tag-icon/16549/9 "2015-02-03T15:04:15Z")

</div>

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": "_" -\> "/"

> [@ohrenkino](#):
>
> It would have been easier to tell you the exact expression if you had told me the exact mask you use to create the filename.

%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

> [@ohrenkino](#):
>
> 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:  
> $validate(%title%,\_)

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]

> [@ohrenkino](#):
>
> 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.

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  
etc.

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

> [@ohrenkino](#):
>
> 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.

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

$replace(%title%,/,\_,)

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

$replace(%title%,/,\_,)(%title%,:,..,)

or

$replace(%title%,/,\_,:,..)

or

$replace((%title%,/,\_,)(:,..))

it just doesn't work

---

_[View the full topic](https://community.mp3tag.de/t/filename-tag-icon/16549)._
