# Whitespaces in path are wiped while renaming

**URL:** https://community.mp3tag.de/t/whitespaces-in-path-are-wiped-while-renaming/54411
**Category:** No Bugs
**Created:** [September 17, 2021, 7:25pm UTC](https://community.mp3tag.de/t/whitespaces-in-path-are-wiped-while-renaming/54411 "2021-09-17T19:25:18Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![msavic123](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/a9a28c/32.png) [@msavic123](https://community.mp3tag.de/u/msavic123)
#### Post date: [September 17, 2021, 7:25pm UTC](https://community.mp3tag.de/t/whitespaces-in-path-are-wiped-while-renaming/54411/1 "2021-09-17T19:25:18Z")

</div>

Hello,  
I would like to report this problem:  
I use tag to filename option to organize mp3 files into folders, like this:

tag-filename  
$left(%artist%,1)%artist%%artist% - %title%

This should do this with path:

from:  
h:\*\*\*\*\*Sort Music\pending\2 Unlimited - Get Ready For This.mp3 (notice few whitespaces in path, \*)

to this:  
h:\*\*\*\*\*Sort Music\pending\2\2 Unlimited\2 Unlimited - Get Ready For This.mp3

But, since the new 3.09 version, whitespaces get deleted from path, and thus all files get moved to new path (without spaces), and it gets a bit annoying.

This is what happens:  
h:\Sort Music\pending\2\2 Unlimited\2 Unlimited - Get Ready For This.mp3

In the last 3.08, this didn't happen.  
How can this be fixed?

Sorry if this was discussed elsewere, but I didn't find it.

---

<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: [September 17, 2021, 7:28pm UTC](https://community.mp3tag.de/t/whitespaces-in-path-are-wiped-while-renaming/54411/2 "2021-09-17T19:28:34Z")

</div>

> [@msavic123](#):
>
> Sorry if this was discussed elsewere, but I didn't find it.

see here:

> [@FILENAME gets white spaces wiped out at its end](https://community.mp3tag.de/t/filename-gets-white-spaces-wiped-out-at-its-end/54389):
>
> To reproduce this bug create a Format Value action 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 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 sim…

and the list of fixed bugs:  
[https://community.mp3tag.de/t/mp3tag-v3-09-released/54399/2](https://community.mp3tag.de/t/mp3tag-v3-09-released/54399/2)

---

<div class="post-metadata">

### Author: ![msavic123](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/a9a28c/32.png) [@msavic123](https://community.mp3tag.de/u/msavic123)
#### Post date: [September 17, 2021, 7:34pm UTC](https://community.mp3tag.de/t/whitespaces-in-path-are-wiped-while-renaming/54411/3 "2021-09-17T19:34:26Z")

</div>

Yes, i saw that post, but this happenes to my path, not filename (i checked, and my filename to tag format leaves all spaces in filename - wherever i put them).

To clarify, i am not using any action for this,

$left(%artist%,1)%artist%%artist% - %title%

is just format in tag - filename option.

---

<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: [September 17, 2021, 7:40pm UTC](https://community.mp3tag.de/t/whitespaces-in-path-are-wiped-while-renaming/54411/4 "2021-09-17T19:40:46Z")

</div>

AS far as I understand the discussion and the Microsoft Specification "File and Folder names that begin or end with the ASCII Space (0x20) will be saved without these characters." means that a folder name with leading or trailing space characters is invalid.

> [@msavic123](#):
>
> my filename to tag format leaves all spaces in filename

The presence of spaces in a filename is not relevant for the data transfer to tag fields.

> [@msavic123](#):
>
> this happenes to my path, not filename

If you rename a file, then the filename is only the partially qualified name. The fully qualified name has the full path.  
So following the logic of the Microsoft specification any folder name with leading or trailing spaces is invalid and MP3tag attempts to write only valid names.

---

<div class="post-metadata">

### Author: ![msavic123](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/a9a28c/32.png) [@msavic123](https://community.mp3tag.de/u/msavic123)
#### Post date: [September 17, 2021, 7:47pm UTC](https://community.mp3tag.de/t/whitespaces-in-path-are-wiped-while-renaming/54411/5 "2021-09-17T19:47:58Z")

</div>

This i'm complaining about happens now in 3.09, and didn't happen in 3.08.

This is how i work, i add few spaces in folder name to keep it at the top. I know WinExplorer doesn't allow those spaces, but i work in TotalCmd.  
WinExplorer tolerates spaces in path, but deletes them on rename or copy.

If Mp3Tag changed way it manipulates files from the last 3.08 version, that may be our answer...

---

<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: [September 17, 2021, 7:53pm UTC](https://community.mp3tag.de/t/whitespaces-in-path-are-wiped-while-renaming/54411/6 "2021-09-17T19:53:46Z")

</div>

> [@msavic123](#):
>
> s in folder name to keep it at the top. I know WinExplorer doesn't allow those spaces,

So you know that you use invalid filenames.  
I

> [@msavic123](#):
>
> If Mp3Tag changed way it manipulates files from the last 3.08 version, that may be our answer...

I don't know if you read the section about fixed bugs:  
"renaming files with creating folders could possibly result in invalid folders names ending with spaces or dots. "  
So, yes, that got changed as it was considered a bug.

Alternatively to the leading space characters, IMHO it would be an option to use leading underscores. These woud be valid characters and lead to valid filenames and folder names.

---

<div class="post-metadata">

### Author: ![msavic123](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/a9a28c/32.png) [@msavic123](https://community.mp3tag.de/u/msavic123)
#### Post date: [September 17, 2021, 8:12pm UTC](https://community.mp3tag.de/t/whitespaces-in-path-are-wiped-while-renaming/54411/7 "2021-09-17T20:12:49Z")

</div>

> [@ohrenkino](#):
>
> So you know that you use invalid filenames.

Like I said, i know WinExplorer doesn't like spaces in path, but windows tolerates them. It is my way of working for a long time, and never had any issues anywhere except for some old cmdline programs.  
It still isn't a problem, but annoyance, i wanted to point out that Mp3Tag's behavior has changed in this matter.

> [@ohrenkino](#):
>
> Alternatively to the leading space characters, IMHO it would be an option to use leading underscores. These woud be valid characters and lead to valid filenames and folder names.

I know about this as well. but i'm not used to it. Anyway it's easier to slap space a few times than to make underscores (it is also easier to read).

Anyway, if author of the program reads this, I would like to ask to allow path AS IS (old behavior).

---

<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 18, 2021, 11:45am UTC](https://community.mp3tag.de/t/whitespaces-in-path-are-wiped-while-renaming/54411/8 "2021-09-18T11:45:34Z")

</div>

> [@msavic123](#):
>
> [...]  
> This is how i work, i add few spaces in folder name to keep it at the top. I know WinExplorer doesn't allow those spaces, but i work in TotalCmd.  
> [...]

For the longest time this used to be also my modus operandi - but I had to give it up as some pieces of software did not complied with Microsoft's approach in this matter while others did do [and so it was creating chaos among my files and folders]

You can read another discussion about this issues here:

[https://freecommander.com/forum/viewtopic.php?f=19&t=8567](https://freecommander.com/forum/viewtopic.php?f=19&t=8567)

For the time being I simply started adding `!` sign before all those white space - this way even if some software decides without my consent to remove them, I still will be able to spot them, as they will be at the top because of that leading mark in form of `!` sign

---

<div class="post-metadata">

### Author: ![Jimmy\_Neutron](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@Jimmy\_Neutron](https://community.mp3tag.de/u/Jimmy_Neutron)
#### Post date: [September 18, 2021, 4:21pm UTC](https://community.mp3tag.de/t/whitespaces-in-path-are-wiped-while-renaming/54411/9 "2021-09-18T16:21:00Z")

</div>

> [@msavic123](#):
>
> This is how i work, i add few spaces in folder name to keep it at the top. I know WinExplorer doesn't allow those spaces, but i work in TotalCmd.

My go-to for making items sort to the top of lists is the underscore character. Legal everywhere, and works everywhere (that I've tried).

---

<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 18, 2021, 4:27pm UTC](https://community.mp3tag.de/t/whitespaces-in-path-are-wiped-while-renaming/54411/10 "2021-09-18T16:27:22Z")

</div>

Moved to #bug-reports:no-bugs

---

<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 18, 2021, 4:28pm UTC](https://community.mp3tag.de/t/whitespaces-in-path-are-wiped-while-renaming/54411/11 "2021-10-18T16:28:24Z")

</div>

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