[Thread Prev][Thread Next][Index]

embedded quotes and arrays ...



Dear Ferret users,

I'm in troubles with quotation signs and substitution ... I need help and hope someone can help me !

Hereafter is an example of what I try to do.

Let's say that station 1 is MID and station 2 is KNO.
The goal is to get 2 symbols (output filename) defined as :

oufile1 = MID.irm.winter94.nc
oufile2 = KNO.irm.winter94.nc

I tried among others this way :

yes? let station = { "MID","KNO" }
yes? list/i=1:2 station
VARIABLE : { "MID","KNO","VLA" }
SUBSET : 2 points (X)
1 / 1:"MID"
2 / 2:"KNO"

yes? repeat/k=1:2 ( define symbol oufile`k` = \`station[i=`k`]\`.irm.winter94.nc )
!-> REPEAT: K=1
**ERROR: command syntax: station[i=
unclosed quotation, parenthesis, or bracket
define symbol oufile1 = `station[i=`k`]`.irm.winter94.nc
Command file, command group, or REPEAT execution aborted

OR

yes? repeat/k=1:2 ( define symbol oufile`k` = ``station[i=`k`]``.irm.winter94.nc )
!-> REPEAT: K=1
**ERROR: command syntax: unpaired quotation marks, grave accent or brackets
define symbol oufile1 = `station[i=`k`]``.irm.winter94.nc
Command file, command group, or REPEAT execution aborted

OR

yes? repeat/k=1:2 ( define symbol oufile`k` = station[i=`k`].irm.winter94.nc )
!-> REPEAT: K=1
!-> define symbol oufile1 = station[i=1].irm.winter94.nc
!-> REPEAT: K=2
!-> define symbol oufile2 = station[i=2].irm.winter94.nc


I have tried lots of combination of grave accents (just some examples hereabove), of symbols, etc., in order to get the right substitution of the array values 'station", but none has worked, I have never got the right substitution of the array 'station'.

I would like to keep these instructions into a REPEAT command and succeed the substitution, as I'll have to use it later to pass variables from ASCII files into NetCDF files (one file for each of my 44 stations, that's why I need the REPEAT command, too long to do by hand !).


Does anyone have any idea ?

Thanks a lot !

Emilie


____________________________________________________________
Emilie VANVYVE
Physicist, PhD student

Université catholique de Louvain (UCL)
Institut d'astronomie et de géophysique G. Lemaître (ASTR)
Chemin du Cyclotron, 2
1348 Louvain-la-Neuve (Belgium)
Phone : +32-(0)10-473300
Fax : +32-(0)10-474722
E-mail : vanvyve@astr.ucl.ac.be
Web : www.astr.ucl.ac.be

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement