# Remove space from filename before file extension

**URL:** <https://community.mp3tag.de/t/remove-space-from-filename-before-file-extension/44546>\
**Category:** Support\
**Created:** [February 14, 2019, 3:37am UTC](https://community.mp3tag.de/t/remove-space-from-filename-before-file-extension/44546 "2019-02-14T03:37:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![megacalm](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/4da419/32.png) [@megacalm](https://community.mp3tag.de/u/megacalm)\
**Post date:** [February 14, 2019, 3:37am UTC](https://community.mp3tag.de/t/remove-space-from-filename-before-file-extension/44546/1 "2019-02-14T03:37:33Z")

</div>

Hello All,

Thought I had this licked but forgot what I did so reaching out for help.

When I convert tag to filename, I want to remove the space that precedes the file extension (or trails the title).

Example filename:

01 - Winter Wonderland - .mp3

I first use mp3 tag to extract the title from the file and put it into the title tag by going convert \> filename \> tag

%dummy%%dummy%- %title%-%dummy%%dummy%

Then I use mp3 tag to render the file name the way I want it by going convert \> tag\> filename so it looks like this:

$num(%track%,2). %title%

1. Winter Wonderland .mp3

However I am left with a space after the title.

How do I get rid of that space?

Thanks!

---

<div class="post-metadata">

**Author:** ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)\
**Post date:** [February 14, 2019, 4:51am UTC](https://community.mp3tag.de/t/remove-space-from-filename-before-file-extension/44546/2 "2019-02-14T04:51:34Z")

</div>

> [@megacalm](#):
>
> I first use mp3 tag to extract the title from the file and put it into the title tag by going convert \> filename \> tag
> 
> %dummy%%dummy%- %title%-%dummy%%dummy%

Your problem is that the title already has a trailing space, because you use the wrong format string for importing. You have to add a space affter the %title% and the last "-":  
"`%dummy% - %dummy% - %title% -` "

To get rid of the already imported spaces in the title you can use the string- function $trim(%title%) with the converter Tag-\>Tag or with an action of the type "Format Value".

---

<div class="post-metadata">

**Author:** ![megacalm](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/4da419/32.png) [@megacalm](https://community.mp3tag.de/u/megacalm)\
**Post date:** [February 15, 2019, 4:50am UTC](https://community.mp3tag.de/t/remove-space-from-filename-before-file-extension/44546/3 "2019-02-15T04:50:14Z")

</div>

That's fantastic, I can see where I went wrong. Thanks so much!

---

<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:27pm UTC](https://community.mp3tag.de/t/remove-space-from-filename-before-file-extension/44546/4 "2026-02-09T12:27:55Z")

</div>


