#!/bin/csh ####################### # by Paul E. Morin PMH # princess mgt hospital # toronto ON canada pmorin@oci.utoronto.ca ####################### # SEE_PROCPAR v1.1 (cProcpar) # this sucker extracts data from those nasty big procpar files by varian # it just parses the procpar files made by the varian spec # so they can be read easily # Its a bit slow since its a cumbersome shell script but its flexible # For you purists out there, I also have a c version # # Note if you improve this little script, send me a copy! ####################### # to set up, # put this file in your bin or other appropriate path in your attainable list # make sure you enable it (chmod +x filename) # type rehash to update youe executables ion your path list (or logout/login) # if you want to change the default parameters in the lsst to be displayed # you can do so below... ######################o # to use: # 1)WHILE IN THE CURRENT DIRECTORY WITH THE procpar FILE YOU WISH TO VIEW # to diplay the default list of parameters... # example: (cd mydata_dir) # cProcpar procpar # -or cProcpar (if no path/file is given procpar is assumed) # # -or to look at specific parameters- # cProcpar procpar tpwr f1180 fsat # # 2) type cProcpar # to extract particular variable(s) of interest # you can modify the lines below to include your favorite varian # variables.. # example: cProcpar mydata_dir/procpar # # -or- cProcpar mydata_dir/procpar f1180 tpwr ####################### set tmp=cProcpar.tmp.awk.$$ \rm $tmp > & /dev/null echo '$1 == variable {' >> $tmp echo ' s = $0' >> $tmp echo ' getline' >> $tmp echo ' printf("%10s is %s\n", variable, $2 )' >> $tmp echo ' exit' >>$tmp echo ' }' >> $tmp chmod +x $tmp set pList = ( sample sw sw1 sw2 ni ni2 np nt dof2 dof sfrq tof \ dfrq dfrq1 dfrq2 d1 f1180 f2180 seqfil array) switch ($#argv) case 0: fold -1350 procpar| tr -d \" > /tmp/procpar.fold.$$ foreach m ($pList) # modify default parameter list above as you wish..... awk -f $tmp variable=$m /tmp/procpar.fold.$$ end breaksw case 1: # enter path for $1 fold -1350 $1 | tr -d \" > /tmp/procpar.fold.$$ foreach m ($pList) awk -f $tmp variable=$m /tmp/procpar.fold.$$ end breaksw cat text >& /dev/null endsw if ($#argv > 1) then fold -1350 $1| tr -d \" > /tmp/procpar.fold.$$ foreach m ($argv[2-]) awk -f $tmp variable=$m /tmp/procpar.fold.$$ end endif if (-e fid) then var2pipe -info -in fid endif \rm $tmp > & /dev/null echo Done. \rm /tmp/procpar.fold.$$