# Splitting a long Filename into 2 fields

**URL:** <https://community.mp3tag.de/t/splitting-a-long-filename-into-2-fields/18359>\
**Category:** Support\
**Created:** [October 22, 2016, 9:06pm UTC](https://community.mp3tag.de/t/splitting-a-long-filename-into-2-fields/18359 "2016-10-22T21:06:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![baldy95307](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/71c47a/32.png) [@baldy95307](https://community.mp3tag.de/u/baldy95307)\
**Post date:** [October 22, 2016, 9:06pm UTC](https://community.mp3tag.de/t/splitting-a-long-filename-into-2-fields/18359/1 "2016-10-22T21:06:31Z")

</div>

I have a bunch of mp3s that were previously named with a "compound" file name that supposedly was to indicate the YEAR and TRACK and used the following filename convention:

2016-001 ARTIST TITLE.mp3 (for track 1)  
2016-002 ARTIST TITLE.mp3 (for track 2)  
2016-003 ARTIST TITLE.mp3 (for track 3), etc.

How do I extract the 3 rightmost characters for the TRACK tag and consequently the leftmost 4 characters for the YEAR tag?

I've tried playing with the "String Functions" such as $right(x,n) but so far no joy.  
Wouldn't "$right(%year%,3) give me "001" which can be the Track tag. Any ideas?

Sleepless in California

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [October 22, 2016, 10:33pm UTC](https://community.mp3tag.de/t/splitting-a-long-filename-into-2-fields/18359/2 "2016-10-22T22:33:27Z")

</div>

Use **_filename \> tag_**![:mt_ftt:](https://community.mp3tag.de/uploads/default/original/1X/6ab8d95b0c2a82cb4f9b0eb16ea87ad3a6575015.png ":mt\_ftt:") with:

```
%year%-%track% %dummy%
```

---

<div class="post-metadata">

**Author:** ![baldy95307](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/71c47a/32.png) [@baldy95307](https://community.mp3tag.de/u/baldy95307)\
**Post date:** [October 23, 2016, 5:09am UTC](https://community.mp3tag.de/t/splitting-a-long-filename-into-2-fields/18359/3 "2016-10-23T05:09:13Z")

</div>

Thanks, that will do the job.

In the meanwhile, I kept pounding away and came away with another solution:

Use Filename to Filename:  
Old pattern = %1-%2 - %3 - %4

New pattern = %1 %2 - %3 - %4

That gets the filename changed into a pattern that'd I'd prefer to use and at the same time, I would then have no problem creating a TRACK tag with:  
%year% %track% - %artist% - %title%"

---

<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:26pm UTC](https://community.mp3tag.de/t/splitting-a-long-filename-into-2-fields/18359/4 "2026-02-09T12:26:29Z")

</div>


