# How To Format Filename \> Tags?

**URL:** https://community.mp3tag.de/t/how-to-format-filename-tags/1620
**Category:** Support
**Created:** [January 13, 2005, 8:34am UTC](https://community.mp3tag.de/t/how-to-format-filename-tags/1620 "2005-01-13T08:34:36Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![adamlau](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/b782af/32.png) [@adamlau](https://community.mp3tag.de/u/adamlau)
#### Post date: [January 13, 2005, 8:34am UTC](https://community.mp3tag.de/t/how-to-format-filename-tags/1620/1 "2005-01-13T08:34:36Z")

</div>

I want to change "Slayer-DecadeOfAgression(CD2)-04-BlackMagic.mp3" (artist-album-track-title) to simply "Slayer - Black Magic.mp3" (artist - track) and have Mp3Tag place the artist and album and track and title information in the ID3 tag. How to do this? I read the FAQ and still do not understand...Thanks!

---

<div class="post-metadata">

### Author: ![Sebastian\_Mares](https://community.mp3tag.de/user_avatar/community.mp3tag.de/sebastian_mares/32/9285_2.png) [@Sebastian\_Mares](https://community.mp3tag.de/u/Sebastian_Mares)
#### Post date: [January 13, 2005, 2:31pm UTC](https://community.mp3tag.de/t/how-to-format-filename-tags/1620/2 "2005-01-13T14:31:18Z")

</div>

You can create a new action set which guesses values. Use _\_FILENAME_ as source format and _%artist%-%album%-%track%-%title%_ as guessing pattern. Then create a new action which formats values. Use _\_FILENAME_ as field and _%artist% - %title%_ as formatstring.  
Using RegEx replace actions, you can also format "HelloWorld" to "Hello World". A quick an dirty example would be replacing _(\u)_ with _$1_ (there is a space before $1). However, this will also change "CD" into " C D".

---

<div class="post-metadata">

### Author: ![adamlau](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/b782af/32.png) [@adamlau](https://community.mp3tag.de/u/adamlau)
#### Post date: [January 23, 2005, 9:51am UTC](https://community.mp3tag.de/t/how-to-format-filename-tags/1620/3 "2005-01-23T09:51:12Z")

</div>

> [@](#):
>
> You can create a new action set which guesses values. Use _\_FILENAME_ as source format and _%artist%-%album%-%track%-%title%_ as guessing pattern. Then create a new action which formats values. Use _\_FILENAME_ as field and _%artist% - %title%_ as formatstring.  
> Using RegEx replace actions, you can also format "HelloWorld" to "Hello World". A quick an dirty example would be replacing _(\u)_ with _$1_ (there is a space before $1). However, this will also change "CD" into " C D".
> 
> \<{POST\_SNAPBACK}\>

The RegEx (\u) with [space]$1 did not perform the expected action. What it did was replace "Al Green-CallMe" to " A l G r e e n - C a l l m e. m p 3". What other regex could i use?

---

<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: [January 23, 2005, 10:09am UTC](https://community.mp3tag.de/t/how-to-format-filename-tags/1620/4 "2005-01-23T10:09:45Z")

</div>

> [@](#):
>
> The RegEx (\u) with [space]$1 did not perform the expected action. What it did was replace "Al Green-CallMe" to " A l G r e e n - C a l l m e. m p 3". What other regex could i use?
> 
> \<{POST\_SNAPBACK}\>

The regular expression is fine, but you have to check the "case-sensitive omparison" checkbox.

Best regards,  
~ Florian

---

<div class="post-metadata">

### Author: ![adamlau](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/b782af/32.png) [@adamlau](https://community.mp3tag.de/u/adamlau)
#### Post date: [January 23, 2005, 9:59pm UTC](https://community.mp3tag.de/t/how-to-format-filename-tags/1620/5 "2005-01-23T21:59:21Z")

</div>

So basically:

1. What regex to use to trim double spaces (to single space) in filename?
2. What regex to use to add single space between open parenthesis and the character left of it?

---

<div class="post-metadata">

### Author: ![nickless](https://community.mp3tag.de/user_avatar/community.mp3tag.de/nickless/32/36_2.png) [@nickless](https://community.mp3tag.de/u/nickless)
#### Post date: [January 24, 2005, 2:35pm UTC](https://community.mp3tag.de/t/how-to-format-filename-tags/1620/6 "2005-01-24T14:35:22Z")

</div>

Hi

> [@](#):
>
> 1. What regex to use to trim double spaces (to single space) in filename?

Field: \_FILENAME  
Regex: [space]+  
Replace with: [space]

> [@](#):
>
> 1. What regex to use to add single space between open parenthesis and the character left of it?

Field: \_FILENAME (or whatever you want)  
Regex: (  
Replace with: [space](

Look into the help for more 😉

nickless

---

<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:19pm UTC](https://community.mp3tag.de/t/how-to-format-filename-tags/1620/7 "2026-02-09T12:19:18Z")

</div>


