[Thread Prev][Thread Next][Index]

Re: limit on number of axes



Hello Martin,
	I typically do such repetitive tasks with a shell script that
calls ferret multiple times - once for each file.  I create a template
of the ferret script with text string(s) such as THISFILE in place of
the actual filename and/or other variable parameter.  For example the
template file might be myjob.tmpl as follows

! myjob.tmpl : template for repetitive task
use THISFILE
! ... series of ferret commands
frame/file=THISGIF

Then the shell script to run it might be the following file runthejob

#! /bin/csh -f
# runthejob : script to do multiple ferret jobs

set count = 0
set total = `ls -1 filestyle*.nc | wc -l`

foreach file (`ls filestyle*.nc`)
  set gif = $file:r.gif
  sed "s/THISFILE/$file;s/THISGIF/$gif/" myjob.tmpl >! job.jnl
  ferret < job.jnl >! job.out
  rm -f ferret.jnl*
  @ count = $count + 1
  echo $count out of $total processed
end

With this file chmod'ed to an executable ( chmod +x runthejob )
then the command runthejob will run through all the files that
match filestyle*.nc and do whatever is needed with each.  The
progress of the script is reported by the echo line.  If the
file names were listed in a file, say filelist.txt , the foreach
line of the shell script might be
	foreach file (`cat filelist.txt`)

Hope this helps,
Mick

|____spillane@pmel.noaa.gov____|
|__Room 2070 Bldg#3 NOAA/PMEL__|
|____Phone_:_(206)526-6780_____|




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement