[Thread Prev][Thread Next][Index]

Re: [ferret_users] string variables and format statements



Another thought, Ned. You can skip lines in your file by defining a second variable with the "strides" syntax.

set data /var="v1_in,v2_in"/form=delim my_file.txt
let npts = v1_in[i=@ngd]
let v1 = v1_in[i=1:`npts`:5]
let v2 = v2_in[i=1:`npts`:5]

Ansley


E. D. Cokelet (Ned) wrote:

I want to read a literal or string variable into Ferret using the fortran format statement feature, but Ferret does not seem to get it right. I tried

set data /var="v1,v2"/format="(1x, f6.2,1x,a6,/////)" my_file.txt

but variable v2 is not recognized as a string variable. Adding /type="num,text" to the statement does not help because that only seems to work with /EZ. I need the /format formulation because I want those /////'s so I can skip lines in the middle of a file. /skip=5 in Ferret would only let me skip lines at the beginning of the file.

Now that Ferret is more string-variable-capable, why can't we have a literal variable type in the format statement?
Any suggestions?
------------------------------------------------------------------------------------------
Edward D. (Ned) Cokelet, Ph.D. Edward.D.Cokelet@noaa.gov
Oceanographer
NOAA/PMEL off: (206) 526-6820
7600 Sand Point Way NE fax: (206) 526-6485
Seattle, WA 98115-6439






[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement