#!/bin/sh # usage: vc2sched infile # infile is vclist generated by sched2vc # outfile is sampling schedule 2d.sched; # point (m-1,n-1) in vclist is (m,n) in sampling schedule; # script ignores comment line and last point of (0,0). # awk 'BEGIN{print "1 1"; linenum=1;firstnum=0;} (($0 !~/#/) && (linenum%2==1)){firstnum=$1;} (($0 !~/#/) && ((firstnum!=0)||($1!=0)) && (linenum%2==0)){printf("%d %d\n", firstnum+1,$1+1);} ($0 !~/#/){linenum++;}' $1 > 2d.sched