I know that plenty of scripts probably already exist for this, but this is a Python script I wrote a while back to automate the sorting, chunking, and filtering of my ROM sets to put on SD cards for the Everdrive flash carts. I hope that someone else will find these helpful.
https://github.com/deusprogrammer/alphadog