#!/bin/sh
#############################################
# Print out the model
# theTab = Dir/file/recno
#############################################

if test -z "$theTab"; then
    test -z "$3" && set $1 $2 1
    theTab="$1/$2/$3"
fi

#ls -l `which tabmap`


NR1=`basename $theTab`
file=`dirname $theTab`
test -z "$NR1" && NR1=1

#echo "#---theTab=$theTab"
echo "#...Execute: tabmap -htx +$NR1 ./$file"
echo1 "\underline{{\bf\large Model from {\fg{red4}$file}}}\par"
tabmap -htx +$NR1 ./$file | gawk 'BEGIN{FS="&"}/^[#%]/{next}/^$/{next}\
   /^ *[0-9]/{ if(Mo==0) Mo=$2; if($2==Mo) print; next }\
   { print  }'
#fcat $file | gawk "NR<$NR1{next}"'\
#  {if(Mo==0) Mo=$2; else if ($2==Mo) print; else exit }' \
#| tabmap -htx -skip $skip $file
