#!/bin/csh -f

setenv LANG C

if ($#argv != 2) then
    echo Usage: $0 'matrix.txt low_time'
    echo '    (over)writes matrix-times-gt{low_time}.txt'
    echo '    solve_times > low_time are sorted descending.'
    exit $#argv
    endif

set tmat = $1
set tmatr = $tmat:r
set low = $2
set outf = ${tmatr}-times-gt${low}.txt

cat $tmat | \
  awk 'NR>1{for(i=2;i<=NF;i++){if(tolower($i) != "inf")print $i;}}' | \
  awk -v low=$low '{if($1 > low) print $1;}' | \
  sort -u -n -r | \
  cat > $outf

