Jump to content

Sort numbers numerically instead of lexicographically


Recommended Posts

To get around the lack of album artist sorting in Poweramp, I use a folder hierarchy with album artists on the top level, dated albums on the next level, and songs on the last level: %album artist%/%date% - %album%/%tracknumber%. %title% is a simplified version of the foobar name format I use to convert/move songs to my phone.


A benefit of this is the albums being sorted chronologically automatically, since my dates are in year.month.day format. This generally works well, but since Poweramp sorts numbers lexicographically, this leads to problems like a February 2003 (2003.2.23) album being sorted after a November 2003 (2003.11.25) album. I would like numbers to be sorted numerically so that dates without leading zeroes sort logically.

Link to comment
Share on other sites

My first thought in the meantime would be to simply use leading zeros when specifying months and days, in the same way as you would for track numbers. Foobar allows you to specify date strings in the fully sortable yyyy-mm-dd format rather than yyyy-m-d.

e.g. the following function:

$date(time)- Retrieves the date part (formatted as YYYY-MM-DD) from a time/date string.
Others are available for just YYYY or DD or MM separately - see http://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_Reference for more details.


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...