#
# mergefiles.sh, 17 Jul 26

for f in metrics[0-9]*.txt
   do
   file=`basename $f .txt`
   file=`echo "${file:7}"` # remove the characters metrics
   awk -v FILE="$file" -e '{gsub(/ $/, "", $0); gsub(/ +/, ",", $0); print FILE "," $0}' < "$f"
   done > allmetrics.csv

for f in [ch]*.txt
   do
   file=`basename $f .txt`
   awk -v FILE="$file" -e '{gsub(/ $/, "", $0); gsub(/ +/, ",", $0); print FILE "," $0}' < "$f"
   done > allgraph.csv

