# Tag from filename recognition

**URL:** <https://community.mp3tag.de/t/tag-from-filename-recognition/16267>\
**Category:** Support\
**Created:** [October 27, 2014, 4:02am UTC](https://community.mp3tag.de/t/tag-from-filename-recognition/16267 "2014-10-27T04:02:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![will279](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/73ab20/32.png) [@will279](https://community.mp3tag.de/u/will279)\
**Post date:** [October 27, 2014, 4:02am UTC](https://community.mp3tag.de/t/tag-from-filename-recognition/16267/1 "2014-10-27T04:02:03Z")

</div>

Hello all,

I have been having some issues. When I try to tag my files from their filenames, the mp3tag program doesn't recognize where one string ends and the other begins. my string is as follows:  
%artist% - %album% %track%. %title%. %title%  
but, when I try to get the tags from the filenames, I only get the first word of an album, and the rest of the words go to the track number.  
for instance:  
Audioslave - Live In Cuba 03. Be Yourself  
is tagged:  
album: Live  
track number: In Cuba 03

is there a way I can make mp3tag only take the last character or two, or the ending characters if they are digits for the track number?

Thanks!

---

<div class="post-metadata">

**Author:** ![spongeAvenger](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/838e76/32.png) [@spongeAvenger](https://community.mp3tag.de/u/spongeAvenger)\
**Post date:** [October 27, 2014, 4:58am UTC](https://community.mp3tag.de/t/tag-from-filename-recognition/16267/2 "2014-10-27T04:58:10Z")

</div>

You need to use separators to tell the program where to make the cut, like this:

Audioslave - Live In Cuba - 03. Be Yourself  
%artist% - %album% - %track%. %title%

---

<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 27, 2014, 7:33am UTC](https://community.mp3tag.de/t/tag-from-filename-recognition/16267/3 "2014-10-27T07:33:37Z")

</div>

> [@spongeAvenger](#):
>
> You need to use separators to tell the program where to make the cut, like this:
> 
> Audioslave - Live In Cuba - 03. Be Yourself  
> %artist% - %album% - %track%. %title%

Y, quite right.  
And as there is no unique separator between title and track no. it does not work. It is just one amorphous string.

What you can do:  
import the middle part with the track no. into TITLE first.  
Then copy TITLE to TRACK and replace the contents with a regular expression:  
Search .\* (\d+)$  
replace with: $1  
And then do a similar thing with the title: throw away the last number:  
(.\*) \d+$  
Replace with: $1

---

<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:** [April 13, 2023, 5:33am UTC](https://community.mp3tag.de/t/tag-from-filename-recognition/16267/4 "2023-04-13T05:33:02Z")

</div>

Closed on April 13, 2023, 5:33am UTC

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