# Get tags from filename question!

**URL:** https://community.mp3tag.de/t/get-tags-from-filename-question/2586
**Category:** Support
**Created:** [December 6, 2005, 2:24pm UTC](https://community.mp3tag.de/t/get-tags-from-filename-question/2586 "2005-12-06T14:24:38Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![isthisthingon](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/898d66/32.png) [@isthisthingon](https://community.mp3tag.de/u/isthisthingon)
#### Post date: [December 6, 2005, 2:24pm UTC](https://community.mp3tag.de/t/get-tags-from-filename-question/2586/1 "2005-12-06T14:24:38Z")

</div>

Hi,  
I,ve got several mp3 files whithout any tags, so i need to read them from the filename. But they're kinda strange formatted and i have no clue how to get the values without manual editing them later.  
The filename is formatted like this: %artist%-%album%-%track%%title%. So my first problem is the missing spaceholder between track and title (track always contains two numbers). But the worst to come, the title doesn't conatin spaceholders between the words either! every word starts uppercase.  
Please, help me with this, manual editing takes much too long!  
Thanks a lot!

---

<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: [December 6, 2005, 2:59pm UTC](https://community.mp3tag.de/t/get-tags-from-filename-question/2586/2 "2005-12-06T14:59:50Z")

</div>

How's this... Create a new action group with the following actions:

Action #1:  
_Action type:_ **Guess values**  
_Source format:_ **%\_filename%**  
_Guessing pattern:_ **%artist%-%album%-%track%%title%**

Action #2:  
_Action type:_ **Format value**  
_Field:_ **TRACK**  
_Formatstring:_ **$left(%title%,2)**

Action #3:  
_Action type:_ **Replace with regular expressions**  
_Field:_ **TITLE**  
_Regular expression:_ **^\d{2}**  
_Replace matches with:_

[] case-sensitive comparison

Action #4:  
_Action type:_ **Replace with regular expressions**  
_Field:_ **TITLE**  
_Regular expression:_ **(\l)(\u)**  
_Replace matches with:_ **$1 $2**

[x] case-sensitive comparison

---

<div class="post-metadata">

### Author: ![isthisthingon](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/898d66/32.png) [@isthisthingon](https://community.mp3tag.de/u/isthisthingon)
#### Post date: [December 6, 2005, 4:45pm UTC](https://community.mp3tag.de/t/get-tags-from-filename-question/2586/3 "2005-12-06T16:45:33Z")

</div>

Well, thanks a lot for your quick reply, but there are still some problems. In case that there's a leading A or I, MP3Tag doesn't insert a blank, this problem also appears with punctuation marks. For example "A Test", "I Test" or "I, Test". Not that I'm an perfectionist, just a bit lazy (:

---

<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: [December 6, 2005, 5:40pm UTC](https://community.mp3tag.de/t/get-tags-from-filename-question/2586/4 "2005-12-06T17:40:55Z")

</div>

> [@](#):
>
> Well, thanks a lot for your quick reply, but there are still some problems. In case that there's a leading A or I, MP3Tag doesn't insert a blank, this problem also appears with punctuation marks. For example "A Test", "I Test" or "I, Test". Not that I'm an perfectionist, just a bit lazy (:
> 
> \<{POST\_SNAPBACK}\>

Well, I can easily adapt it to add a blank before every uppercase letter, but that would change the song "Last Night A DJ Saved My Life" into "Last Night A D J Saved My Life" --\> notice how "DJ" turns to "D J".

---

<div class="post-metadata">

### Author: ![isthisthingon](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/898d66/32.png) [@isthisthingon](https://community.mp3tag.de/u/isthisthingon)
#### Post date: [December 6, 2005, 6:07pm UTC](https://community.mp3tag.de/t/get-tags-from-filename-question/2586/5 "2005-12-06T18:07:38Z")

</div>

Didn't reason that! Thanks (:

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [December 6, 2005, 6:17pm UTC](https://community.mp3tag.de/t/get-tags-from-filename-question/2586/6 "2005-12-06T18:17:36Z")

</div>

If you don't mind the DJ thing, you can take **(\w|,)(?=\u)** instead of **(\l)(\u)**

---

<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/get-tags-from-filename-question/2586/7 "2026-02-09T12:19:32Z")

</div>


