# flac.flac / mp3.mp3

**URL:** <https://community.mp3tag.de/t/flac-flac-mp3-mp3/17860>\
**Category:** Support\
**Created:** [April 17, 2016, 1:23pm UTC](https://community.mp3tag.de/t/flac-flac-mp3-mp3/17860 "2016-04-17T13:23:54Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [April 17, 2016, 1:46pm UTC](https://community.mp3tag.de/t/flac-flac-mp3-mp3/17860/3 "2016-04-17T13:46:19Z")

</div>

> [@zerow](#):
>
> I would like to know, if Mp3tag supports manipulation of the file extension? Very rarely I somehow end up with files that have filename like  
> Abc **flac.flac** instead of Abc **.flac**  
> or  
> X Y Z **mp3.mp3** instead of X Y Z **.mp3**...

As your example show, there is only the need to remove trailing text from the filename, where the trailing text contains the name of the file extension, e .g. ' flac' or ' mp3'.  
Apply functions like $regexp, $cutRight, $left, $replace, $if, $eql, $ifgreater, and variables like %\_filename% and %\_extension%.

Examples ...

**\_FILENAME \<== $replace(%\_filename%'$',' '%\_extension%'$',)****\_FILENAME \<== $trimRight($replace(%\_filename%'$',%\_extension%'$',))****\_FILENAME \<== $regexp(%\_filename%,'\s+'%\_extension%'$',)****\_FILENAME \<== $regexp(%\_filename%,'(\s\*'%\_extension%')\*$',)**

But it would be better you check the other code, which have introduced the failure.

DD.20160417.1804.CEST, DD.20160505.1656.CEST

---

_[View the full topic](https://community.mp3tag.de/t/flac-flac-mp3-mp3/17860)._
