# Howto fill 2 tags from one filename element in one single step?

**URL:** <https://community.mp3tag.de/t/howto-fill-2-tags-from-one-filename-element-in-one-single-step/47475>\
**Category:** Support\
**Created:** [January 8, 2020, 4:35pm UTC](https://community.mp3tag.de/t/howto-fill-2-tags-from-one-filename-element-in-one-single-step/47475 "2020-01-08T16:35:40Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![gigi.com](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/54ee81/32.png) [@gigi.com](https://community.mp3tag.de/u/gigi.com)\
**Post date:** [January 8, 2020, 4:35pm UTC](https://community.mp3tag.de/t/howto-fill-2-tags-from-one-filename-element-in-one-single-step/47475/1 "2020-01-08T16:35:40Z")

</div>

Hello,

via the _Filename - Tag_ converter one can simply fill tags from a file and folder structure. This works straight forward in the case where one fills one single tag from one filename part, e.g.

_10.000 Maniacs(1993) MTV Unplugged\01 - These Are Days.mp3_  
and  
_%artist%(%year%) %album%%track% - %title%_

But how can I fill _2 tags from one single filename part_?

I need to fill the year **and** the album tag from the name of the album in the filename, so that the album is not _MTV Unplugged_, but _(1993) MTV Unplugged_ and I want to do that **in one single conversion step**.

How can I do this?

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [January 8, 2020, 4:44pm UTC](https://community.mp3tag.de/t/howto-fill-2-tags-from-one-filename-element-in-one-single-step/47475/2 "2020-01-08T16:44:47Z")

</div>

> [@gigi.com](#):
>
> How can I do this?

You can't.  
You have to import the data first to one tag field and then copy it from there.

---

<div class="post-metadata">

**Author:** ![gigi.com](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/54ee81/32.png) [@gigi.com](https://community.mp3tag.de/u/gigi.com)\
**Post date:** [January 9, 2020, 6:36pm UTC](https://community.mp3tag.de/t/howto-fill-2-tags-from-one-filename-element-in-one-single-step/47475/3 "2020-01-09T18:36:26Z")

</div>

That's what I did so far, it is unfortunate that my requirement does not work. To whom can I send this requirement and how?

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [January 9, 2020, 6:46pm UTC](https://community.mp3tag.de/t/howto-fill-2-tags-from-one-filename-element-in-one-single-step/47475/4 "2020-01-09T18:46:16Z")

</div>

I doubt that it is physically possible to have 2 fieldnames in exactly the same space in pattern. They will always appear in sequence and consequently define a new pattern.  
But perhaps you have a trick up your sleeve and you can enlighten me where I am too narrowminded.

The forum posts are regularly read by the developer, so your idea will not be lost.

---

<div class="post-metadata">

**Author:** ![gigi.com](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/54ee81/32.png) [@gigi.com](https://community.mp3tag.de/u/gigi.com)\
**Post date:** [January 9, 2020, 7:45pm UTC](https://community.mp3tag.de/t/howto-fill-2-tags-from-one-filename-element-in-one-single-step/47475/5 "2020-01-09T19:45:50Z")

</div>

This is only a matter of syntax.

In a first approximation one could think about simply specifying an arbitrary list of instructions concatenated with an & sign that then would be executed one after the other:

%artist%/(%year%) %dummy%/%track% - %title% & %dummy%/%album%/%dummy%

Next, one could define a new syntax element, e.g. a binary -\> operator, like, e.g.

%artist%/() -\> ((%year%) %dummy%, %album%)/%track% - %title%

I would also like to add a cover from the folder.jpg file inside of my folder in this step, which I also currently do via an extra action, but this is perhaps yet another story.

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [January 9, 2020, 7:54pm UTC](https://community.mp3tag.de/t/howto-fill-2-tags-from-one-filename-element-in-one-single-step/47475/6 "2020-01-09T19:54:46Z")

</div>

See, I was too narrowminded.

What you could do: use just one action of the type "Guess value" in which you prepare the source string in such a way that the data that is to be copied to several fields appears in the appropriate number of repetitions. THis could probably be done with a $regexp() function in which you use the $x parameters for the copies.  
e.g. `$regexp("10.000 Maniacs(1993) MTV Unplugged\01 - These Are Days",(.*)\((\d+)\) (.*)\\(.*),$1==$2==$2 $3==$4)`  
which leads to a string like  
`10.000 Maniacs==1993==1993 MTV Unplugged==01 - These Are Days`  
which you could then import to  
%artist%==%year%==%album%==%title%

---

<div class="post-metadata">

**Author:** ![gigi.com](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/54ee81/32.png) [@gigi.com](https://community.mp3tag.de/u/gigi.com)\
**Post date:** [January 10, 2020, 3:12pm UTC](https://community.mp3tag.de/t/howto-fill-2-tags-from-one-filename-element-in-one-single-step/47475/7 "2020-01-10T15:12:10Z")

</div>

thanks for pointing me to the regex functionality. I'm wondering whether one can use this idea directly in the Filename-to-Tag conversion, i.e. without defining an extra action.

I'm currently struggeling with the definition of the action you mentioned. Note also, that between the group name and the album name there is a backslash, too, which is not included in my initial post, because of the fact that tis editor here does print \( as (.

Damn... what the hell does this editor here, there are also other special characters that are not rendered as they are typed in...

10.000 Maniacs\(1993) MTV Unplugged\01 - These Are Days

I checked the following regex with an online regex tester and it seems to be okay:

(.\*)\\\((\d+)\) (.\*)\\(\d+) - (.\*)

I currently don't know, how to give the system the string, with %1 or so, like this:

 ![image](https://community.mp3tag.de/uploads/default/original/2X/4/477e8cd2e9860a3356d8cff7c15127193d0d68dc.png)

Unfortunately, this leads to a syntax error.

Could you be so kind to post how I need to fill in the fields in the action definition dialog above, surely, there is an error in.

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [January 10, 2020, 3:33pm UTC](https://community.mp3tag.de/t/howto-fill-2-tags-from-one-filename-element-in-one-single-step/47475/8 "2020-01-10T15:33:10Z")

</div>

%1 as parameter in the place of the $regexp() function where it expects a string or string reference leads to an error as %1 is just %1. If you want to treat the contents of the \_FILENAME, use %\_filename%.

The regexp part

> [@gigi.com](#):
>
> (._)\((\d+)) (._)\(\d+) - (.\*)

looks ok to me, but you can test it inside MP3tag with Convert\>Tag-Tag  
You would need to modify

> [@ohrenkino](#):
>
> $1==$2==$2 $3==$4)

to  
`$1==$2==$2 $3==$4==$5)`  
and

> [@ohrenkino](#):
>
> %artist%==%year%==%album%==%title%

to  
`%artist%==%year%==%album%==%track%==%title%`

Please note that the "==" is not mandatory, it just helps to create a unique separator between the parts of the input string %\_FILENAME%.

I am still puzzled why you want to avoid actions when they could be addressed by name whereas Converter patterns can't.  
Also I do not understand why you want to get it done in just one action, when the call of an action group with several actions in it (including the cover import) is just as quick and does so much more.

---

<div class="post-metadata">

**Author:** ![gigi.com](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/54ee81/32.png) [@gigi.com](https://community.mp3tag.de/u/gigi.com)\
**Post date:** [January 11, 2020, 4:19pm UTC](https://community.mp3tag.de/t/howto-fill-2-tags-from-one-filename-element-in-one-single-step/47475/9 "2020-01-11T16:19:03Z")

</div>

Hi,

I tried many many things out today and as a result, it seems to me that the regex parser in mp3tag does not work as, e.g. the regex tester in [https://regex101.com](https://regex101.com), which indicates to me that either the mp3tag regex parser does not work or I am doing something fundamentally wrong.

Note also, that _\_filename_ is not correct. This information field contains only the filename itself, i.e. _01 - These Are Days_.  
We need to pass also the _\_directory_ and the _\_parent\_directory_ to the parser.

Btw. I'm wondering how one can go another step above in the folder hierarchy. There is no \_parent\_parent\_directory information field 🙂.

Good, let's play a bit with the Convert Tag-\>Tag functionality, because it goes faster.

I tried out the following regex and string

_10.000 Maniacs\(1993) MTV Unplugged\01 - These Are Days_  
_(.\*)\\(\d+)_

[regex101.com](http://regex101.com) gives me back the 2 matches

_10.000 Maniacs\(1993) MTV Unplugged_  
_01_

which seems okay.

**But** , mp3tag's Tag-\>Tag Converter indicates me with

$regexp(%\_parent\_directory%\%\_directory%\%\_filename%, (.\*)\(\d+), $1==$2)

this here

_10.000 Maniacs\(1993) MTV Unplugged==01 - These Are Days_

which is not correct because the second match is _01 - These Are Days_ instead of only _01_.

What now?

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [January 11, 2020, 4:44pm UTC](https://community.mp3tag.de/t/howto-fill-2-tags-from-one-filename-element-in-one-single-step/47475/10 "2020-01-11T16:44:10Z")

</div>

> [@gigi.com](#):
>
> What now?

There is hardly any use to lament over the differences between the results of some other test program and that what MP3tag makes of your regular expressions. You have to get them to work inside MP3tag.  
Also, could you please enclose any code in accent grave (top left to bottom right) so that all the special characters stay in place?  
I tried this and it looks ok to me:  
`$regexp("10.000 Maniacs\(1993) MTV Unplugged\01 - These Are Days",(.*)\\\((\d+)\) (.*)\\(\d+) - (.*),$1==$2==$2 $3==$4==$5)`  
`->10.000 Maniacs==1993==1993 MTV Unplugged==01==These Are Days`

---

<div class="post-metadata">

**Author:** ![gigi.com](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/54ee81/32.png) [@gigi.com](https://community.mp3tag.de/u/gigi.com)\
**Post date:** [January 11, 2020, 5:23pm UTC](https://community.mp3tag.de/t/howto-fill-2-tags-from-one-filename-element-in-one-single-step/47475/11 "2020-01-11T17:23:22Z")

</div>

Hi,

I have it... as I said, I did something fundamentally wrong. In those cases where nothing works there is always a simple solution:

**I typed _spaces_ after each comma in the `$regexp` function** , which one should never never do. I noticed this already several time ago, but I'm making always the same mistake.

`$regexp(%_parent_directory%\%_directory%\%_filename%, (.*)\\\((\d+)\) (.*)\\(\d+) - (.*), $1==$2==($2) $3==$4==$5)`

is different from

`$regexp(%_parent_directory%\%_directory%\%_filename%,(.*)\\\((\d+)\) (.*)\\(\d+) - (.*),$1==$2==($2) $3==$4==$5)`

And, yes, I'm aware of the fact that some regex test page shouldn't be compared with the tool, one must get run the thing inside of the tool itself.

Thanks for pointing me to the formatting functions of this editor, me stupid.

I have to thank you also for mentioning the action groups and that one can simply add actions to them. I, so far, had only one single action in it and wasn't at all aware of the group functionality. I must admit that until now, I mainly worked with the convert (ALT + x) menu and didn't dig so deeply into the powerful actions.

But the main thing, I learned from this thread was the usage of the regexp function and ist signature.

Many thanks for all this. I will try now to define all my manual steps into one single action and will hopefully succeed.

---

<div class="post-metadata">

**Author:** ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)\
**Post date:** [February 9, 2026, 12:28pm UTC](https://community.mp3tag.de/t/howto-fill-2-tags-from-one-filename-element-in-one-single-step/47475/12 "2026-02-09T12:28:23Z")

</div>


