Hi Group,
Is there a way of getting the string from the last command
(standard output from ferret) into a variable? For example, text output from:
If so, then I would like to be able to assign a local variable to relevant variables that exist from a netCDF file read, for example.
This way, I can avoid having to use d=n in subsequent expressions in a ferret journal file when more than one netCDF file has been read in.
For example, use coads_climatology show data/brief !somehow get string into variable a. let a="1> /cs/datastore/csdar/cec006/ferret/data/coads_climatology.cdf (default)" let b=strrindex(a,">")-1 let c=substring(a,0,b) !assign any variables that are let slpa=slp[d=`c`] !now variable can be utilised without specifying a data file number. shade slpa[l=1]
A useful extension might be to assign all variables in a given file a label.
In the coads_climatology example, these might be: ssta, airta, speha, wspda, uwnda, vwnda, slpa, where the file variables are not always known in advance (through show data n command, and text manipulation).
Many thanks, Mark. |