Hi everyone,

I am trying to create a list of albums in txt mode, one line per album with the date-modified date in the front, like this:

2009-9-8 Electronica - Daft Punk - Homework

My script:

$loop(%_folderpath%,1)$regexp(%_file_mod_date%,(\d{1,2})/(\d{1,2})/(\d{4}),$3-$1-$2)    %genre% - $if2(%albumartist%,%artist) - %album% '['$replace(%_codec%,Free Lossless Audio Codec,FLAC)']'

I tried to use the "iflonger" as well as the "ifgreater" function inside the regexp function, but that does not seem to work. How can I have a ZERO precede all those days and months that are less than "less than 10".

Result should be:


as well as

2009-10-22 and not 2009-010-022

If anyone knows how to do this, please let me know!

Thank you. :slight_smile:

Hmm ... my computer regional setting is "Deutsch (Deutschland)" and my short date setting is "JJJJ-MM-TT" accordingly to ISO 8601.
Therefore Mp3tag's system variable %_file_mod_date% returns 2009-10-03 and I can use it without any additionally scripting modification.

Try this export script ...


... and see what results do you get.


Thank you Detlev,

that helped - I figured it out and it should work this way:


This yields

2009-09-08    Electronic - Daft Punk - Homework

from what once was


Thank you! :slight_smile:

Okay, only problem is now that I cannot sort inversely - or at least it seems a bit too confusing for me. Sorting normally works fine now, but the latest date will end up way down on the bottom of the list. When using $loop($sub...)) it ends up as shown below.

$loop($sub(%_folderpath%,10000000000))$loop(%_folderpath%,1)$num($regexp(%_file_mod_date%,'(\d{1,2}).(\d{1,2}).(\d{4})',$3),2)-$num($regexp(%_file_mod_date%,'(\d{1,2}).(\d{1,2}).(\d{4})',$1),2)-$num($regexp(%_file_mod_date%,'(\d{1,2}).(\d{1,2}).(\d{4})',$2),2)    %genre% - $if2(%albumartist%,%artist) - %album% '['$replace(%_codec%,Free Lossless Audio Codec,FLAC)']'


2009-10-02    Pop/Rock - Artist A - Album B [FLAC]
2009-09-03    Pop/Rock - Artist C - Album D [FLAC]
2009-09-03    Pop/Rock - Artist C - Album E [FLAC]
2009-09-03    Soundtrack - Artist A - Album T [FLAC]
2009-09-07    Soundtrack - Artist C - Album F [FLAC]
2009-09-08    Electronic - Artist D - Album E [FLAC]

Seems to be the same problem with how the date is displayed internally - how would I fix this looping inversely $loop($sub...))? Any idea? :slight_smile:

Thank you.

I think ... for the latest date at the top you need a formula like this ...


Thank you for your kind help. Since I am only listing albums this does not work, as it ends up showing me multiple lines for albums depending on the minute a file in there was changed, I guess. Is there any way to use the output generated by the regexp (2009-09-22 etc.) for sorting?

Thank you. :huh:

Maybe ...

  • try a loop like $loop(%album%,1)
  • try a formula like $div($sub(10000000000,%_file_mod_datetime_raw%),3600)
  • try a formula like $div($sub(10000000000,%_file_create_datetime_raw%),3600)


Alright, I thought I would post what I ended up with - I am quite pleased with this export config. Some problems popped up when using the RAW datetime: for example, if an album gets tagged at 1am of day 1 and another at 9pm of the same day, the RAW times are too far apart to allow for proper sorting. So what I did was generate an 8-digit number by pulling together YYYY-MM-DD to YYYYMMDD. This gets subtracted and from 10000000000 and allows for proper reverse sorting.

Sample script right here:

List created %_datetime%

$loop($sub(10000000000,$num($regexp(%_file_mod_date%,'(\d{1,2}).(\d{1,2}).(\d{4})',$3),2)$num($regexp(%_file_mod_date%,'(\d{1,2}).(\d{1,2}).(\d{4})',$1),2)$num($regexp(%_file_mod_date%,'(\d{1,2}).(\d{1,2}).(\d{4})',$2),2)))$loop(%albumartist%)$loop(%album%,1)$num($regexp(%_file_mod_date%,'(\d{1,2}).(\d{1,2}).(\d{4})',$3),2)-$num($regexp(%_file_mod_date%,'(\d{1,2}).(\d{1,2}).(\d{4})',$1),2)-$num($regexp(%_file_mod_date%,'(\d{1,2}).(\d{1,2}).(\d{4})',$2),2) '['%genre%']' $if2(%albumartist%,%artist) '/' %album% '('%year%')' '['$replace(%_codec%,Free Lossless Audio Codec,FLAC)']'

Again, thanks for all the help - maybe this helps someone also trying to reverse-sort! :slight_smile:

Yes, this is a rather old thread, but it is worth to demonstrate a simplification for converting MDY date to YMD date.

The given MDY date (Month/Day/Year) should be a valid MDY value and can be of format ...
... that means the year must be a 1- or 2- or 4-digit year, the month and day values must have 1- or 2-digits.

The result is a YMD (Year-Month-Day) date of format ...
... that means, the year will be always a 4-digit year, the month and day values have always a 2-digit format, zero padded at the left side, if needed.
A given 1- or 2-digit year will not be automatically left padded with a century value (what century should be valid?), so that a given year of "9" or "09" will be padded to "0009".



Here is a shorter script with the same purpose, ...
sort by Date modified reverse, Albumartist or Artist, Album.

1: $filename($getEnv('USERPROFILE')'\Desktop\Mp3tag.List.Album.DateModReverse.txt',UTF-8)'List created '%_datetime%

2: $loop($sub(4000000,$div(%_file_mod_datetime_raw%,86400)))$loop($if2(%ALBUMARTIST%,%ARTIST%))$loop(%ALBUM%,1)
3: %_file_mod_date%' ['%GENRE%'] '$if2(%ALBUMARTIST%,%ARTIST%)' / '%ALBUM%' ('%YEAR%') ['$replace(%_codec%,'Free Lossless Audio Codec','FLAC')']'$loopend()$loopend()$loopend()

Example output:

List created 2014-09-26 11:57:04

2014-08-05 [Rock] Genesis / Foxtrot (1972) [MPEG 1 Layer III]
2014-06-29 [Hardrock] Tzunami / Reanimation (2005) [MPEG 1 Layer III]
2014-04-30 [Soundtrack] Nine Inch Nails / ''The Perfect Drug'' (1997-06-09) [MPEG 1 Layer III]
2014-03-04 [Other] Gordon Goodwins Big Phat Band /  (2009-03-20) [MPEG 1 Layer III]
2014-03-04 [Electronica] Tipper / Surrounded (2003) [MPEG 1 Layer III]
2014-01-19 [Soul, Jazz, Easy Listening] Sade / The Best of Sade (1994) [MPEG 1 Layer III]
2014-01-12 [Rock] Fehlfarben / 26 1/2 (2006-02-26) [MPEG 1 Layer III]
2014-01-11 [Rock] Aerosmith / Big Ones (1994) [MPEG 1 Layer III]
2014-01-11 [Rock] Aerosmith / Greatest Hits (1980-10-01) [MPEG 1 Layer III]
2013-12-23 [Rock] Alannah Myles / Black Velvet (2007-09-28) [MPEG 1 Layer III]
2013-11-22 [Rock] Michael Fehst, Gerd Klein / The Orange Cover (2008-07-14) [MPEG 2 Layer III]


Yes. It is the raw datetime converted to days (60sec/min60min/h24h=86400sec) that makes the difference.
Well done DetLev.