# Space before extension

**URL:** <https://community.mp3tag.de/t/space-before-extension/49343>\
**Category:** Support\
**Created:** [June 17, 2020, 2:58pm UTC](https://community.mp3tag.de/t/space-before-extension/49343 "2020-06-17T14:58:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![JWCherner](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@JWCherner](https://community.mp3tag.de/u/JWCherner)\
**Post date:** [June 17, 2020, 2:58pm UTC](https://community.mp3tag.de/t/space-before-extension/49343/1 "2020-06-17T14:58:00Z")

</div>

MP3TAG automatically adds a space plus the .mp3 extension to all of my file names, so they look like the following:  
FileName .mp3  
How do I get rid of the blank space before .mp3?  
Thank you.  
[JCherner@gmail.com](mailto:JCherner@gmail.com)

---

<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:** [June 17, 2020, 3:35pm UTC](https://community.mp3tag.de/t/space-before-extension/49343/2 "2020-06-17T15:35:59Z")

</div>

MP3Tag does nothing automatically but always as you tell it to to.  
So how do you create the filename?  
Do you use a format string and how does it look like?

---

<div class="post-metadata">

**Author:** ![Crissov](https://community.mp3tag.de/user_avatar/community.mp3tag.de/crissov/32/6619_2.png) [@Crissov](https://community.mp3tag.de/u/Crissov)\
**Post date:** [June 18, 2020, 5:06am UTC](https://community.mp3tag.de/t/space-before-extension/49343/3 "2020-06-18T05:06:22Z")

</div>

Sounds like a job for the `$trim()` function, but weʼd need more details to tell you where to use it.

---

<div class="post-metadata">

**Author:** ![Cookie\_Monster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cookie_monster/32/7_2.png) [@Cookie\_Monster](https://community.mp3tag.de/u/Cookie_Monster)\
**Post date:** [June 18, 2020, 1:06pm UTC](https://community.mp3tag.de/t/space-before-extension/49343/4 "2020-06-18T13:06:55Z")

</div>

Looks like a space character has sneaked in in one of your format strings or your title tag names. Probably at the end, where it's naturally hard to spot unless the cursor is at the very end.

---

<div class="post-metadata">

**Author:** ![JWCherner](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@JWCherner](https://community.mp3tag.de/u/JWCherner)\
**Post date:** [June 19, 2020, 7:18am UTC](https://community.mp3tag.de/t/space-before-extension/49343/5 "2020-06-19T07:18:27Z")

</div>

> [@Crissov](#):
>
> $trim()

Thank you. You were right.

---

<div class="post-metadata">

**Author:** ![JWCherner](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@JWCherner](https://community.mp3tag.de/u/JWCherner)\
**Post date:** [June 19, 2020, 7:21am UTC](https://community.mp3tag.de/t/space-before-extension/49343/6 "2020-06-19T07:21:17Z")

</div>

You were right. I was using the following format string for filename: %title% %artist% %track%. Track was empty. So I was getting a space before .mp3. I changed it to $trim(%title% %artist% %track%). That corrected the problem.

---

<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:** [June 19, 2020, 7:29am UTC](https://community.mp3tag.de/t/space-before-extension/49343/7 "2020-06-19T07:29:45Z")

</div>

> [@JWCherner](#):
>
> Track was empty.

If you have fields that are not always present, you can use the following syntax to leave them out:  
`%title% %artist%[%track%]`  
Items in only appear if the referenced field is present.

---

<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/space-before-extension/49343/8 "2026-02-09T12:28:40Z")

</div>


