# Fill Title Tag with data from the filename

**URL:** https://community.mp3tag.de/t/fill-title-tag-with-data-from-the-filename/12914
**Category:** Support
**Created:** [January 9, 2012, 9:04pm UTC](https://community.mp3tag.de/t/fill-title-tag-with-data-from-the-filename/12914 "2012-01-09T21:04:38Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![volaholick](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/d78d45/32.png) [@volaholick](https://community.mp3tag.de/u/volaholick)
#### Post date: [January 9, 2012, 9:04pm UTC](https://community.mp3tag.de/t/fill-title-tag-with-data-from-the-filename/12914/1 "2012-01-09T21:04:38Z")

</div>

I have a bunch of filenames that follow the same string pattern NXxxxxx\_NN. Every one of them ends in an \_NN some start with a number like above and some don't. All of them only have an \_ character in them though. What I am wanting to do is delete everything prior to and also delete the \_ but then add Chapter in its place. So I want the above to be changed to Chapter NN. I want the result to be placed in the Title field.

---

<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: [January 10, 2012, 5:21am UTC](https://community.mp3tag.de/t/fill-title-tag-with-data-from-the-filename/12914/2 "2012-01-10T05:21:38Z")

</div>

> [@volaholick](#):
>
> ... Every one of them ends ... like above and some don't...

Please give examples for all the variations you want to transform.  
According to my experience, the suggested measures do not quite fit the reality if the OP only tells what he thinks is relevant.  
Also, it is not quite clear what you really want: do you want to fill the title tag (as the headline suggests) or do you want to rename the files as in the following you only talk about the filenames and that all the modifications should be performed on the filename - which is a little unusual.

If you want to import the part of the filename up to the underscore, then use the converter filename - tag and enter a mask like this:  
%title%\_%dummy%  
This leaves out everything after the underscore - as you claim:

> [@](#):
>
> What I am wanting to do is delete everything prior to and also delete the \_

But I think that you want to replace the \_ with "Chapter " - which is easily done with an action - see  
[/t/967/1](https://community.mp3tag.de/t/967/1)

you then end up with data in the title tag that still has the number as head.  
You can remove that (if it really is 2 characters wide) with an action of the type "format tag field" for TITLE and the format string  
$cutleft(%title%,2).  
You may then rename the files with the converter Tag-Filename.  
But as I said: I am not sure, what you really want.

---

<div class="post-metadata">

### Author: ![volaholick](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/d78d45/32.png) [@volaholick](https://community.mp3tag.de/u/volaholick)
#### Post date: [January 10, 2012, 12:56pm UTC](https://community.mp3tag.de/t/fill-title-tag-with-data-from-the-filename/12914/3 "2012-01-10T12:56:51Z")

</div>

Yeah, sorry about that. It wasn't very descriptive. What I have are all the books of the bible. The filenames are labeled 1Chronicles\_01, 1Cor\_01, 1Kings\_01... So the 01 at the end is the chapter of each book. So 1 Chronicles has 1Chronicles\_01, 1Chronicles\_02, 1Chronicles\_03... for each of the Chapters. Now, I want the title field to have Chapter 01, Chapter 02, Chapter 03... so that I can just jump right to that Chapter when I need it. I have the Album labeled with the name of the book. Your topic above %dummy%\_%title% worked perfect in getting the two numbers at the end of the filename to appear as the title. So now I have 01, 02, 03... in the title and I just need to add Chapter (with a space after) before 01.

---

<div class="post-metadata">

### Author: ![volaholick](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/d78d45/32.png) [@volaholick](https://community.mp3tag.de/u/volaholick)
#### Post date: [January 10, 2012, 1:03pm UTC](https://community.mp3tag.de/t/fill-title-tag-with-data-from-the-filename/12914/4 "2012-01-10T13:03:31Z")

</div>

Nevermind... your second portion got the rest completed. I just created a format value action using:

_Field:_ TITLE  
_Format string:_ Chapter %title%

Thanks for your help...

---

<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/fill-title-tag-with-data-from-the-filename/12914/5 "2026-02-09T12:23:33Z")

</div>


