# $if2 statement at converter Filename to Tag

**URL:** <https://community.mp3tag.de/t/if2-statement-at-converter-filename-to-tag/51710>\
**Category:** Mac\
**Created:** [January 23, 2021, 11:53pm UTC](https://community.mp3tag.de/t/if2-statement-at-converter-filename-to-tag/51710 "2021-01-23T23:53:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![djdizzle](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/ed8c4c/32.png) [@djdizzle](https://community.mp3tag.de/u/djdizzle)\
**Post date:** [January 23, 2021, 11:53pm UTC](https://community.mp3tag.de/t/if2-statement-at-converter-filename-to-tag/51710/1 "2021-01-23T23:53:31Z")

</div>

Hi,

I'm just wanting some clarification with an $if2 statement.

`/%dummy%/%dummy%/%dummy%/%CONTENTGROUP%/%dummy%_%dummy% - %artist%/$if2(%dummy%_%TITLE%_%DUMMY%,%TITLE%_%DUMMY%)`

Filename 1: `ES_Colliding_PN`  
Filename 2: `Amsterdam_PN`

I don't think I have the statement inputted correctly, as no tags are being written.

---

<div class="post-metadata">

**Author:** ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)\
**Post date:** [January 24, 2021, 6:42am UTC](https://community.mp3tag.de/t/if2-statement-at-converter-filename-to-tag/51710/2 "2021-01-24T06:42:13Z")

</div>

Scripting functions are not supported when importing tags from filename. The idea however is interesting, but I think it would make the format strings and the pattern matching involved quite complex.

Applying the format string at "Filename - Tag" is already a pattern matching problem and each conditional in the format string would branch to another pattern matching alternative.

Regarding a possible solution to what you're trying to achieve: you could import the last component of the filename to the `TITLE` field and use regular expressions to extract the part you want to keep.

---

<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 26, 2021, 5:56pm UTC](https://community.mp3tag.de/t/if2-statement-at-converter-filename-to-tag/51710/3 "2021-02-26T17:56:53Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
