#! /opt/bin/dash # PATH="/bin:/usr/bin"; export PATH sed 's/,//g' time4.out | awk 'BEGIN { min=100; max=0; } { n=$1; t[n][$2] = $3; if(nmax) max=n; } END { printf("%30s\n", "number of threads"); printf( "%4s", "n"); for( d=1; d<=32; d*=2) printf( " %9i", d); printf( "\n"); for( n=max; n>=min; --n) { printf( "%4d", n); for( d=1; d<=32; d*=2) printf( " %9.2f", t[n][d]); printf( "\n"); } printf("---\n"); # for plot: for( d=1; d<=32; d*=2) { printf( " %4i", d); for( n=min; n<=max; ++n) printf( " %9.2f", t[n][d]); printf("\n"); } }' > .j head -9 .j > table4.out tail -n +11 .j > table4.data rm .j