script for 'rawtranning' all files in a directory