# FILENAME gets white spaces wiped out at its end

**URL:** https://community.mp3tag.de/t/filename-gets-white-spaces-wiped-out-at-its-end/54389
**Category:** Fixed Bugs
**Tags:** bug-fixed
**Created:** [September 15, 2021, 1:05pm UTC](https://community.mp3tag.de/t/filename-gets-white-spaces-wiped-out-at-its-end/54389 "2021-09-15T13:05:48Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)
#### Post date: [September 15, 2021, 1:05pm UTC](https://community.mp3tag.de/t/filename-gets-white-spaces-wiped-out-at-its-end/54389/1 "2021-09-15T13:05:48Z")

</div>

To reproduce this bug create a `Format Value` action

```auto
Field: _FILENAME
Format string: %_filename%'''

```

where every `'` sign means one space [used here to make it visible]

Result? None whatsoever as no spaces are added to the end of `FILENAME`. But if you modify that action to

```auto
Field: _FILENAME
Format string: %_filename%'''X

```

then the action will add three space and and `X` sign at the end of `FILENAME`

` `  
` `  
This is happening in versions 3.08b and 3.08d - but was not happening in 3.06a  
` `  
` `  
This is similar to this bug, that was taken care of:

> [@\[F\] Automatic removal of pauses at the end of FILENAME](https://community.mp3tag.de/t/f-automatic-removal-of-pauses-at-the-end-of-filename/18382/3):
>
> The \>\>'\<\< sign will indicate a pause in the description 1] Create in file manager \>\>Song'''.mp3\<\< 2] Display it in %\_FILENAME% column [without extension, so that you will see \>\>Song'''\<\<, although appearing to you as \>\>Song\<\<] 3] Click that file in that column as if you are about to change its name. You should get a selection of \>\>Song'''\<\< 4] Now click on Windows Taskbar or any other file in the list in Mp3tag In theory you did not change the name, because you backed out. In reality, if y…

---

<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: [September 15, 2021, 1:39pm UTC](https://community.mp3tag.de/t/filename-gets-white-spaces-wiped-out-at-its-end/54389/2 "2021-09-15T13:39:05Z")

</div>

> **[Whitespace characters in file and folder names - Windows Client](https://docs.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/file-folder-name-whitespace-characters)**
>
> Describes support for whitespace characters in file and folder names.

---

<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: [September 16, 2021, 1:19pm UTC](https://community.mp3tag.de/t/filename-gets-white-spaces-wiped-out-at-its-end/54389/3 "2021-09-16T13:19:00Z")

</div>

It seems like the report is about files with whitespace before the dot of the file extension, whereas the linked documentation describes that no whitespace is allowed after the file extension.

It seems that [one of the latest changes](https://community.mp3tag.de/t/ordner-anlegen-mit-konverter-und-aktion/53987) made it impossible to create filenames with whitespace before the dot of the file extension.

Can you confirm or am I missing something?

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [September 16, 2021, 1:48pm UTC](https://community.mp3tag.de/t/filename-gets-white-spaces-wiped-out-at-its-end/54389/4 "2021-09-16T13:48:15Z")

</div>

> [@Florian](#):
>
> Can you confirm or am I missing something?

The Preview-Button shows the correct/expected result, but the final filename seems to get "trimmed":

```auto
C:\Temp\01 - Filename with trailing spaces .mp3
  "" ->
  "Filename with trailing spaXes .mp3"

```

also the Preview in the Tag-\>Tag Convert window:  
 ![image](https://community.mp3tag.de/uploads/default/original/2X/1/185bca0a4fe4486b13228c2254dc5ccb211bf8ec.png)  
It doesn't matter if you use `%title%` or `%_filename%` or `%_filename_ext%` in the format string. The trailing spaces between the filename and the dot (before the extension) get trimmed.

---

<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: [September 16, 2021, 2:30pm UTC](https://community.mp3tag.de/t/filename-gets-white-spaces-wiped-out-at-its-end/54389/5 "2021-09-16T14:30:37Z")

</div>

> [@Florian](#):
>
> Can you confirm or am I missing something?

Yes. I can confirm this.

> [@LyricsLover](#):
>
> The Preview-Button shows the correct/expected result, but the final filename seems to get "trimmed"

With the converter Tag-\>Filename the preview is also trimmed, with converter Tag-\>Tag the preview shows the traling spaces.

---

<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: [September 17, 2021, 11:29am UTC](https://community.mp3tag.de/t/filename-gets-white-spaces-wiped-out-at-its-end/54389/6 "2021-09-17T11:29:56Z")

</div>

This should be fixed with a last-minute fix in Mp3tag v3.09. Thanks for reporting and all your feedback!

---

<div class="post-metadata">

### Author: ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)
#### Post date: [September 17, 2021, 12:38pm UTC](https://community.mp3tag.de/t/filename-gets-white-spaces-wiped-out-at-its-end/54389/7 "2021-09-17T12:38:46Z")

</div>

And so it seems that this issue in gone in v3.09

Thank you for a fast remedy

---

<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: [October 17, 2021, 12:39pm UTC](https://community.mp3tag.de/t/filename-gets-white-spaces-wiped-out-at-its-end/54389/8 "2021-10-17T12:39:39Z")

</div>

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