# USB Drive Sorter/Alphabetizer Program (v0.1)



## MWisBest (Oct 5, 2017)

I noticed my JVC head unit does not sort the folders of a USB drive alphabetically; instead, it's just in the order the folders were created on the drive. So (for example) if I added an "All That Remains" folder, it would be the last folder in order, instead of one of the first. After hearing somebody else had the same issue with a fancy Pioneer AVH-4200NEX, I figured this must be a widespread issue, so I made a program to fix it and thought I'd share it here in case anybody else needed it.

https://github.com/MWisBest/StereoUSBSorter/releases

It's really simple to use:































It doesn't need to be run as an administrator or anything, and the code is all there for anybody to inspect or improve or whatever. I've done the best I can to make it safe, i.e. one small issue won't completely destroy your drive like some of the alternative programs I discovered, but I still suggest you *make a backup or your files before using this!*

How it works is pretty simple. In layman's terms, a flash drive has a table listing all the folders on it, and when you add a new folder, it just gets tacked on to the end of the table. Simple embedded devices like a head unit read this table as-is, and don't sort it afterwards like your PC does. So to fix it, I go through all the folders in alphabetical order, I move them to a temporary folder, and then move them back. Effectively what this does to the table is move that folder to the end of the table. Do this in order to every folder, and it's sorted. This doesn't rewrite/stress the drive or anything, it only takes a few seconds to complete.


----------



## Truthunter (Jun 15, 2015)

My Alpine does the same. I'll have to try this out. Thanks!


----------



## MWisBest (Oct 5, 2017)

Truthunter said:


> My Alpine does the same. I'll have to try this out. Thanks!


Did you get a chance to try it yet? I still haven't heard from anybody else that it worked for them lol, would like to know before I spend any more time on programming it.


----------



## Sine Swept (Sep 3, 2010)

I used a program before called Drivesort. I had similar issues while using a Kenwood radio with USB. The index would show files as they were created. The newest date would become the last file, not alphabetical.


----------



## Alain93 (Mar 6, 2017)

Works great on my Pioneer. Thanks MWisBest


----------



## Firefighter9 (Sep 23, 2015)

This is a life saver. No more moving all my files back on to my computer so that I can add a new folder. Thanks!!!


----------



## MWisBest (Oct 5, 2017)

Sine Swept said:


> I used a program before called Drivesort. I had similar issues while using a Kenwood radio with USB. The index would show files as they were created. The newest date would become the last file, not alphabetical.


The problem I have with DriveSort and all the other programs like it, is they modify the filesystem at a very low level and are completely specific to FAT32. My program is less risky IMO, it works on other filesystems like exFAT, and it should run on Mac and Linux as well (using Mono).



Alain93 said:


> Works great on my Pioneer. Thanks MWisBest





Firefighter9 said:


> This is a life saver. No more moving all my files back on to my computer so that I can add a new folder. Thanks!!!


Glad to hear it's working for you guys, thanks! I'm still working on other features as well like custom sorting and an interface that isn't so ugly


----------



## MWisBest (Oct 5, 2017)

New update coming soon!


----------



## ominous (Apr 21, 2017)

Is it possible to sort the songs in the folder by track number (possibly in a future release)? 

One of my biggest gripes is when you play a folder and the songs are listed alphabetically instead of by track number. Screws with transitions from one song to the next. I need a program that sorts albums alphabetically, then the songs within a folder by track number as the artist intended.


----------



## MWisBest (Oct 5, 2017)

ominous said:


> Is it possible to sort the songs in the folder by track number (possibly in a future release)?
> 
> One of my biggest gripes is when you play a folder and the songs are listed alphabetically instead of by track number. Screws with transitions from one song to the next. I need a program that sorts albums alphabetically, then the songs within a folder by track number as the artist intended.


From what I can tell, head units are sorting individual files alphabetically, instead of by drive order/date like folders. I just prefix my file names with the track numbers, e.g. "01. Track Name.flac". I don't think there's any way around that unfortunately. I could add automatic file renaming based on the tags of each file, but that's about it. :/


----------



## jlj93byu (Sep 25, 2018)

I just tried it and it worked for me. I had 350 folders on a larger USB flash drive and it worked just fine. Only took a few seconds.


----------



## karmajack (May 9, 2017)

I'll give this a try next time I add something. 
I use a 64 GB flash drive with my 6100 Nex about 3/4 full. I've been using Drivesort with no issue, but willing to try this if the UI is cleaner and simpler. I go so long between adding stuff, that I have to relearn Drivesort procedures every time.


----------

