If you are running Linux here is a little script to sort recursively your files on your SD card (of course it also works with any storage):
Code: Select all
#!/bin/sh
# Usage:
# findalpha [-R]
# Reorder the directory entries according to alphanumerical order, so
# find output is in order. Useful for preparing files for play on an
# MP3 player that follows directory order.
# If -R is given, do recursively.
# Thu Dec 27 02:47:00 EST 2007 v. 0.1 jh initial version
# Wed Oct 22 11:08:00 EST 2008 v. 0.2 andrew-regner added support for directories with spaces
# TODO:
# figure out why it works on IDE but not on USB, even if the FS is ext3
start="`pwd`"
if [ "$1" = "-R" ] ; then
dirs=`find . -type d`
else
dirs=.
fi
for dir in $dirs; do
test "$sdir" != "" && dir="$sdir $dir"
if [ ! -d "$dir" ]; then
sdir="$dir"
continue
fi
cd "$dir"
tmp=`mktemp -d -p .`
find . -maxdepth 1 -mindepth 1 | grep -v $tmp | xargs -n1 -d"\n" -I'{}' mv '{}' $tmp
cd $tmp
find . -maxdepth 1 -mindepth 1 | sort -n | xargs -n1 -d"\n" -I'{}' mv '{}' ..
cd ..
rmdir $tmp
cd "$start"
done
Usage is quite simple: open a terminal, change the current directory to the one you want to sort. Then just type "findalpha". Or type "findalpha -R" to sort recursively.
Example:
Code: Select all
~$ cd /media/HXC/
/media/HXC$ findalpha -R