# Custom First Letter Field

**URL:** https://community.mp3tag.de/t/custom-first-letter-field/12477
**Category:** Support
**Created:** [September 4, 2011, 8:28pm UTC](https://community.mp3tag.de/t/custom-first-letter-field/12477 "2011-09-04T20:28:36Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Guttersnipe](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/ebca7d/32.png) [@Guttersnipe](https://community.mp3tag.de/u/Guttersnipe)
#### Post date: [September 4, 2011, 8:28pm UTC](https://community.mp3tag.de/t/custom-first-letter-field/12477/1 "2011-09-04T20:28:36Z")

</div>

Hello Guys in MP3tag forums!

First I'd like to thank the developer of this program and all those who have contributed in these forums, you have probably saved months if not years of my life!

I have a question that you may be able to help with

I am currently in the process off overhauling/cleaning how I catalogue and tag my MP3 files  
One of the things I am doing is adding a custom field to the tags of all my MP3s called FIRSTLETTER  
The purpose of doing this is that I currently sort my music in the following way

Music\%firstletter%\%artist% - %album%$num(%track%,2) - %title% (currently being changed to Music\%firstletter%\%artist%\%album%$num(%track%,2) - %title%)  
and  
Music! Compilations\%album%$num(%track%,2) - %artist% - %title% (for compilations)

The firstletter field allows me to easily file tracks away both in the main library and when I want to move or copy files to external devices and keep the folder structure nearly identical.  
Up until now I have been populating this field manually but it occurred to me during this overhaul that I could probably do this automatically which would save a great deal of time with compilations

I have attempted what was suggested in an [earlier post on this forum](https://community.mp3tag.de/t/1179/1) and inserted this into a format value action and it works but I was wondering if I could take it a step further with your help.

Is there any way to add exclusions to the expression such as excluding the word 'The' for example.

Any help is greatly appreciated.  
Thanks

\m/ Guttersnipe \m/

---

<div class="post-metadata">

### Author: ![JJ\_Johnson](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jj_johnson/32/67_2.png) [@JJ\_Johnson](https://community.mp3tag.de/u/JJ_Johnson)
#### Post date: [September 4, 2011, 9:00pm UTC](https://community.mp3tag.de/t/custom-first-letter-field/12477/2 "2011-09-04T21:00:59Z")

</div>

Create an action group containing several actions:

1. First, create a temporary field and copy artist name.

_Action type:_ **Format value**  
_Field:_ **TEMP**  
_Format string:_ **%artist%**

1. Remove any leading article.

_Action type:_ **Replace with regular expression**  
_Field:_ **TEMP**  
_Regular expression:_ **^(the|el|los|la|las|le|les)\s(.+)$**  
_Replace matches with:_ **$2**  
[] _case-sensitive comparison_

1. Grab the first letter of the temporary field.

_Action type:_ **Format value**  
_Field:_ **FIRSTLETTER**  
_Format string:_ **$left(%temp%,1)**

1. Then delete the temporary field.

_Action type:_ **Remove fields**  
_Fields to remove:_ **TEMP**

---

<div class="post-metadata">

### Author: ![JJ\_Johnson](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jj_johnson/32/67_2.png) [@JJ\_Johnson](https://community.mp3tag.de/u/JJ_Johnson)
#### Post date: [September 4, 2011, 9:03pm UTC](https://community.mp3tag.de/t/custom-first-letter-field/12477/3 "2011-09-04T21:03:43Z")

</div>

It's also possible to do it in a single action.

_Action type:_ **Format value**  
_Field:_ **FIRSTLETTER**  
_Format string:_ **$left($regexp(%artist%,^(the|el|los|la|las|le|les)\s'('.+')'$,$2,1),1)**

---

<div class="post-metadata">

### Author: ![JJ\_Johnson](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jj_johnson/32/67_2.png) [@JJ\_Johnson](https://community.mp3tag.de/u/JJ_Johnson)
#### Post date: [September 4, 2011, 9:08pm UTC](https://community.mp3tag.de/t/custom-first-letter-field/12477/4 "2011-09-04T21:08:25Z")

</div>

Also be aware that once you've renamed the file, there's no good reason to keep the field FIRSTLETTER, since it's easily recreated from the artist name. You can place this action after your action (or action group) that renames the file:

_Action type:_ **Remove fields**  
Fields to remove: **FIRSTLETTER**

---

<div class="post-metadata">

### Author: ![Guttersnipe](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/ebca7d/32.png) [@Guttersnipe](https://community.mp3tag.de/u/Guttersnipe)
#### Post date: [September 6, 2011, 5:12pm UTC](https://community.mp3tag.de/t/custom-first-letter-field/12477/5 "2011-09-06T17:12:15Z")

</div>

Thanks you very much for this.  
I think I'll keep the field as occasionally i copy and sort files according to the first letter and it ouwld be nice to have the field there ready.

Many thanks for your efforts though! 😃

---

<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:23pm UTC](https://community.mp3tag.de/t/custom-first-letter-field/12477/6 "2026-02-09T12:23:19Z")

</div>


