#!/bin/csh -f

if ($#argv == 0) then
 echo "USAGE: prcol start [end]"
 echo "  prints only start column if no end"
 exit 2;
endif

if ("$2" != "") then
 set range=1
 set startcol=$1
 set endcol=$2
else 
 set range=0
 set coln=$1
endif

if ($range) then
 awk -v n1=$startcol -v n2=$endcol '{for (i=n1; i<=n2; i++) {printf "%s ", $i}}{printf "\n"}'
else
 awk -v n=$coln '{print $n}'
endif
