# print subset of file with timestamp between # specified startSec and endSec. # timeStamp is in first column # Presumes that file timestamps are sorted in increasing order. BEGIN { ### print "ARGC: " ARGC; if (ARGC < 3) { print "usage: startSec endSec timestamp-file"; exit; } startSec = ARGV[1]; ARGV[1] = ""; endSec = ARGV[2]; ARGV[2] = ""; ### printf "startSec: %d endSec: %d\n", startSec, endSec; if (endSec <= startSec) { printf "endSec must be greater than startSec\n"; exit; } } NF == 0 { next; } /^#/ { next; } { if ($1 >= startSec && $1 < endSec) { print; } if ($1 > endSec) { # All done exit; } } END { }