# Max year of all the tracks

**URL:** https://community.mp3tag.de/t/max-year-of-all-the-tracks/50587
**Category:** Support
**Created:** [October 26, 2020, 8:37pm UTC](https://community.mp3tag.de/t/max-year-of-all-the-tracks/50587 "2020-10-26T20:37:30Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![dev91618](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/b19c9b/32.png) [@dev91618](https://community.mp3tag.de/u/dev91618)
#### Post date: [October 26, 2020, 8:37pm UTC](https://community.mp3tag.de/t/max-year-of-all-the-tracks/50587/1 "2020-10-26T20:37:31Z")

</div>

Hello.  
I want to merge vol 1, vol 2... directories.

I want to include the latest year in the directory name in case vol 1, vol2... year is different.

So is there a way I can find the max year of the selected tracks?

Thanks a lot.

---

<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 26, 2020, 9:12pm UTC](https://community.mp3tag.de/t/max-year-of-all-the-tracks/50587/2 "2020-10-26T21:12:37Z")

</div>

As Mp3tag does not compare data of 2 or more files I doubt that there is a way to find a maximum or minimum way than to sort by the year field and treat the found values manually.

---

<div class="post-metadata">

### Author: ![dev91618](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/b19c9b/32.png) [@dev91618](https://community.mp3tag.de/u/dev91618)
#### Post date: [October 27, 2020, 1:54pm UTC](https://community.mp3tag.de/t/max-year-of-all-the-tracks/50587/3 "2020-10-27T13:54:26Z")

</div>

OK thanks for your help nevertheless.  
But can I store previous file's year in a variable and replace with newer if its larger? Or is it exactly what you mean that mp3tag doesn't do? Thanks again.

---

<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, 2020, 2:56pm UTC](https://community.mp3tag.de/t/max-year-of-all-the-tracks/50587/4 "2020-10-27T14:56:10Z")

</div>

I doubt that this is possible as you say

> [@dev91618](#):
>
> previous file's year

MP3tag only knows the properties of the current file - and not those of the previous or the next file.  
You may use an export script ... but writing that and getting the data back in probably takes just as long as doing it manually.

Here is a thread that does some calculation over several files - perhaps you can get something out of that export script:

> [@calculate average bitrate](https://community.mp3tag.de/t/calculate-average-bitrate/19540/4):
>
> Hmm, you may do such mathematics within an export script, which can create for example a CSV text file, which provides all the related data like filename and the other calculated data, for later import. As a starting point ... to calculate average bitrate ... $filename($getEnv('USERPROFILE')'\Desktop\Mp3tag.Report.Bitrate.txt',UTF-8) $loop(%\_path%)$puts(SUMBITRATE,$add($get(SUMBITRATE),%\_bitrate%))$puts(SUMTRACKS,$if(%\_bitrate%,$add($get(SUMTRACKS),1),$get(SUMTRACKS)))$loopend() 'Max Tracks …

---

<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:28pm UTC](https://community.mp3tag.de/t/max-year-of-all-the-tracks/50587/5 "2026-02-09T12:28:54Z")

</div>


