# Trimming ALL does not work like it does for FILENAME

**URL:** https://community.mp3tag.de/t/trimming-all-does-not-work-like-it-does-for-filename/46640
**Category:** Support
**Created:** [October 4, 2019, 5:07pm UTC](https://community.mp3tag.de/t/trimming-all-does-not-work-like-it-does-for-filename/46640 "2019-10-04T17:07:06Z")
**Posts on this page:** 4
**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: [October 4, 2019, 5:07pm UTC](https://community.mp3tag.de/t/trimming-all-does-not-work-like-it-does-for-filename/46640/1 "2019-10-04T17:07:06Z")

</div>

I want to remove all pauses at the beginning and end of fields  
``  
``  
So if

`Format value "_FILENAME": "$trim(%_FILENAME%)"`

works for FILENAME, then why does

`Format value "_ALL": "$trim(%_ALL%)"`

works for none of the fields?  
``  
``  
Yes, I can use Replace with regular expression for removing one pause

`Regular expression "_ALL": "^\s" -> ""`

`Regular expression "_ALL": "\s$" -> ""`

but how about removing multiple white spaces stacked together?

---

<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: [October 4, 2019, 8:03pm UTC](https://community.mp3tag.de/t/trimming-all-does-not-work-like-it-does-for-filename/46640/2 "2019-10-04T20:03:49Z")

</div>

I think that \_ALL refers to all TAG fields - and as the filename is a file property for the file system, it does not part of tags.

> [@Zerow](#):
>
> but how about removing multiple white spaces stacked together?

see the Howtos:

> [@Actions and batch-operations](https://community.mp3tag.de/t/actions-and-batch-operations/967/10):
>
> How to remove/trim leading and trailing spaces [Video tutorial for these actions](http://www.vimeo.com/7756545) Leading spaces: Action type: Replace with regular expressions Field: \_TAG Regular expression: ^\s+ Replace matches with: ^ matches the beginning of the string. Then \s+ searches for all whitespaces till a different char occurs. The whitespaces found will be replaced by nothing and, thus, deleted. Trailing spaces: Action type: Replace with regular expressions Field: \_TAG Regular expression: \s+$ Replace matc…

---

<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: [October 5, 2019, 5:19pm UTC](https://community.mp3tag.de/t/trimming-all-does-not-work-like-it-does-for-filename/46640/3 "2019-10-05T17:19:38Z")

</div>

> [@ohrenkino](#):
>
> [...]see the Howtos:  
> [Actions and batch-operations - #10 by dano](https://community.mp3tag.de/t/actions-and-batch-operations/967/10)

Thank you. I now use  
`Regular expression "_ALL": "^\s+" -> ""`

`Regular expression "_ALL": "\s+$" -> ""`

`Format value "_FILENAME": "$trim(%_FILENAME%)"`  
` `  
` `  
But the stange thing is that

`Regular expression "_ALL": "^\s+" -> ""`

works also for ` `FILENAME [removing all the leading spaces in it], but

`Regular expression "_ALL": "\s+$" -> ""`

does not [leaving all the trailing spaces]

And that

`Format value "_FILENAME": "$trim(%_FILENAME%)"`

is suppose to take out only what is at the beginning and not also that what is at the end - and yet this one line of code takes care of both

---

<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/trimming-all-does-not-work-like-it-does-for-filename/46640/4 "2026-02-09T12:28:16Z")

</div>


