...
Write in perl. Start from ~cottrell/bin/template.pl or ~cottrell/sumdir-regexp.pl. Use the perl opendir function to get the directory listing. Use /bin/gunzip or bin/zcat to uncompress (unzip) the files. Use stat if you need file size etc. Look at File::Copy for copying files.
...