# how to delete the before the filename

**URL:** https://community.mp3tag.de/t/how-to-delete-the-before-the-filename/14082
**Category:** General Discussion
**Created:** [November 4, 2012, 11:16am UTC](https://community.mp3tag.de/t/how-to-delete-the-before-the-filename/14082 "2012-11-04T11:16:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![evergreen1](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/a9adbd/32.png) [@evergreen1](https://community.mp3tag.de/u/evergreen1)
#### Post date: [November 4, 2012, 11:16am UTC](https://community.mp3tag.de/t/how-to-delete-the-before-the-filename/14082/1 "2012-11-04T11:16:08Z")

</div>

when viewed in explorer, i see a space before some of the filenames in a folder. when checked in Mp3tag, there is no space seen. when i apply " delete a character before the title action" i get a character deleted which means there is no space as such as per mp3tag. but when viewed in explorer, it is seen like this

filename  
artist  
album

how can i rectify this?

---

<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: [November 4, 2012, 1:45pm UTC](https://community.mp3tag.de/t/how-to-delete-the-before-the-filename/14082/2 "2012-11-04T13:45:22Z")

</div>

You can format the filename with an action of the type "Format tag field" and the format string  
$trim(%\_filename%)  
This removes leading and trailing spaces.

Of if this is just a display problem, check the definition for the column with the filesname and whether it has a leading space.

---

<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: [November 4, 2012, 1:47pm UTC](https://community.mp3tag.de/t/how-to-delete-the-before-the-filename/14082/3 "2012-11-04T13:47:04Z")

</div>

> [@evergreen1](#):
>
> when viewed in explorer, i see a space before some of the filenames in a folder. when checked in Mp3tag, there is no space seen. ...

If Windows explorers displays a space character in front of the filename, then there might be a character, which looks like a space character.

Basically, the Windows explorer does not allow to manually create a filename with a leading space character, but in a commandline window or by Mp3tag automatism it is possible to create such a filename.

If Mp3tag has created this filename, then the originator of the space character is almost certainly **you**.  
**You** need to investigate vigorously the scripting expression and find out, how the leading space character has been introduced.

If you will be not successful with the investigation, then a foolproof method will be:  
surround the complete scripting expression with a function $trim().

DD.20121104.1544.CET
