[Thread Prev][Thread Next][Index]

Re: [ferret_users] string variables and format statements



Hi Ned,
The current method for reading strings from an ascii file into Ferret is with the SET VAR/TYPE=DELIM command. You can specify the type of the data or let Ferret detect it. It's designed to read files like spreadsheet outputs, where there may be some columns with text and others with numeric data. The documentation can be found under "Ascii data, reading delimited" and "SET DATA/FORMAT=DELIMITED" in the Users Guide index.  I'll add more index entries under "text" and "string variables" headings. Note that the default delimiter between colomns is a tab or comma. If your file has spaces between the entries in each record, you will need to specify   /DELIMITER=" "

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