# Clean up filenames

**URL:** https://community.mp3tag.de/t/clean-up-filenames/69947
**Category:** Support
**Created:** [October 8, 2025, 12:05pm UTC](https://community.mp3tag.de/t/clean-up-filenames/69947 "2025-10-08T12:05:30Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mamyllyn](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@mamyllyn](https://community.mp3tag.de/u/mamyllyn)
#### Post date: [October 8, 2025, 12:05pm UTC](https://community.mp3tag.de/t/clean-up-filenames/69947/1 "2025-10-08T12:05:30Z")

</div>

Hello,

I did use lot of this program back in the past and remember that there was some function to “clean all filenames”. So let’s say that you had a filename that was wrong like this:

”01-W.A.S.P. -Love Machine” and it should be “01 - W.A.S.P. - Love Machine” it did correct every filename with a regular impression. With this function it was easy to clean the whole library at once.

Is this function still available as I can not 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: [October 8, 2025, 12:14pm UTC](https://community.mp3tag.de/t/clean-up-filenames/69947/2 "2025-10-08T12:14:29Z")

</div>

> [@mamyllyn](#):
>
> every filename with a regular impression

I would use Convert\>Tag-Filename and rewrite the filename in toto with e.g.  
Format string: %track% - %artist% - %title%

---

<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: [October 8, 2025, 12:18pm UTC](https://community.mp3tag.de/t/clean-up-filenames/69947/3 "2025-10-08T12:18:16Z")

</div>

> [@mamyllyn](#):
>
> some function to “clean all filenames”.

Are you referring to the `$validate` function?

From the [String functions](https://docs.mp3tag.de/scripting/#string-functions) part of the documentation:

> `$validate(x,y)` returns the given file name/path x with all invalid characters `/?*"<>|:` replaced by the string y.

---

<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 8, 2025, 12:23pm UTC](https://community.mp3tag.de/t/clean-up-filenames/69947/4 "2025-10-08T12:23:43Z")

</div>

> [@mamyllyn](#):
>
> ”01-W.A.S.P. -Love Machine” and it should be “01 - W.A.S.P. - Love Machine”

If you want to replace a single hyphen with "space hyphen space", then a simple "Replace" should be enough.

Also, see here:

> [@Add hyphen in filename for all tracks](https://community.mp3tag.de/t/add-hyphen-in-filename-for-all-tracks/69346):
>
> Hello, I have quite basic question but let´s see what is the best way to do this. My tags are ok but the filename is like this: 01 W.A.S.P. - Never Say Die I would like to rename all filenames like this: 01 - W.A.S.P. - Never Say Die If I use quick action to replace the empty space in the start with - it adds this to every empty space. How could I make it so that it adds the hyphen only after the track number?

---

<div class="post-metadata">

### Author: ![mamyllyn](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@mamyllyn](https://community.mp3tag.de/u/mamyllyn)
#### Post date: [October 8, 2025, 12:55pm UTC](https://community.mp3tag.de/t/clean-up-filenames/69947/5 "2025-10-08T12:55:20Z")

</div>

Thank you once again for good hints!

---

<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: [November 7, 2025, 12:56pm UTC](https://community.mp3tag.de/t/clean-up-filenames/69947/6 "2025-11-07T12:56:00Z")

</div>

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