I have written a script to take input files, copy specific data and output a combined file (see code below). Id like to make it so that I just have to specify a directory on the command line so that the script will automatically work on all the contained files - any help much appreciated!