#!/bin/bash
# So you are in bash.
cd dir-that-has-the-files
mkdir ../sorted-dirs
for file in $(ls -1 *_*_*_*_*) # or just * if you know all the files in here are subject
do
dir=$(echo $file | cut -f4 -d'_')
destdir=../sorted_dirs/$dir
mkdir -p $destdir
cp -a $file $destdir
done