You need to read files on fly and copy them using some tricks:
Code:
#!/bin/sh
SEARCHDIR="$1"
DESTDIR="$2"
find $SEARCHDIR-name "*[HH]*.doc" -exec echo '{}' \; | while read LINE
do
f="$LINE"
d=$(dirname "$f")
ff=$(echo "$f" | awk -F"$d" '{ print $2}')
mydir=$(echo $ff | cut -b1-5)
mkdir $DESTDIR/$mydir
Coping file: $f => $DESTDIR/${mydir}${ff}
cp "$f" "$DESTDIR/${mydir}${ff}"
done
hope this helps. Read above code carefully till u understand it very well...