Friday, July 4, 2014

Autophile: Automatically Sort Files into Folder by Name

I like to mark my student's reports electronically rather than mark paper copies. I type faster than I write and I can copy/paste verbose comments when students do similar things. The major drawback is getting the work back to the students; it's always a painstaking process to manipulate each file into an email or a folder. To reduce that grunt-work I wrote a program that will move files into folders with similar names. I call it Autophile.

The idea is to get your students to put their student ID in the file name so that the software can sort each student's work into their own folder on the network drive. Choose the files you want to sort, select the folders you want to sort them into, adjust settings, and click "Sort"

A confirmation window will pop up telling you where the program thinks each file should go. You can make adjustments or cancel the process. Clicking "Apply Sort" will move the files.

Confirmation Window
The program computes the best match between folder and file by computing something called the Damerau–Levenshtein distance. Basically, it's the number of letters you would have to substitute, remove, insert, or swap to make a portion of the file name look like the folder name.

I was having problems with very short folder names getting picked up as the best match so I modified the result a little bit to favor longer, less accurate matches over shorter accurate matches. I weighted the D-L distance at 100% and the match length at 90% when doing the comparison. For example, I wanted to favor a match that was 5 letters long with one letter wrong over a match that was 3 letters wrong with no errors.

You can download the program here or the source code here.


  1. I am a lawyer in Brazil , and that helped me a lot in the organization of my files , thank you

  2. it is a really great help for me...thank you

  3. Hello, i am a slow learner and usually tough for me to learn new software. Your software by far is the best and easiest to use, this was exactly what I was looking for. You saved me so much time and effort. Thanks a bunch!