[Thread Prev][Thread Next][Index]

Re: large number of variable



Hi Vincent,

If your file indeed contains the characters "oui" (column 2) then you will need
to use the /FORMAT qualifier to skip over this field. Attempting to read "oui"
as a number may be the source of your error message.

You are correct, however, that the limit to the number of variables that Ferret
will read simultaneously from an ASCII file is 20:

  See the V4.4 Users GuidePart II: COMMANDS REFERENCE, 26.2 SET DATA_SET
  (http://dread.pmel.noaa.gov/home/ferret/ug/v44/partII.html#_2_18) under
  "SET DATA/EZ/ VARIABLES= " it confirms:
  ==> "The maximum number of variables allowed in a single data set is 20."

You can use a /FORMAT qualifier to skip over un-needed columns and effectively
reduce the number of variables in the file. For example, if the file has 22
data columns of width 8 characters each and you can skip the first 2 columns
with

	FILE/FORMAT="(16x,20F8.1)"/var="v1,v2,v3,...,v20" my_file.dat

If you absolutely need all 22 columns you can create a Unix symbolic link (the
"ln -s" command, effectively giving 2 names to the same file) and use the FILE
command twice, capturing half of the variables from each FILE.

I hope this helps.

	- steve

P.S. The Unix "sed" command can be used to provide a more comprehensive
solution to text fields such as "oui" embedded in the file.

============================

On Mar 21, 11:59am, Vincent PAROUX Stagiaire ENIB wrote:
> Subject: large number of variable
> Hi,
>
> I use FERRET Version 4.4, and I would like to read an ASCII file which
> contains 22 variables, stored in a single column each
> Example:
> (Col_1   Col_2  ...  Col_22)
>
>   1      oui          120
>   2      oui          119
>   .       .            .
>   .       .            .
>   .       .            .
>   5      non           130
>
> I tried to read this file with the command:
> FILE/VAR="VAR_NAME1,VAR_NAME2,...?VAR_NAME22" ascii_filename
> But when I tried the command:LIST VAR_NAME1 I have this answer:
>  **TMAP ERR: unknown error number
>              Last or next-to-last record read:
>  Value1 value2 value3 value4 ... value11 val
>              Data set: ./ascii_filename
>              Data file: ./ascii_filename
> where valueN are the value of the first line of my file.
>
> My question is:
> Is there a max number of variable that I can use with ferret or if not
> How can I do to read my file ?
>
> Thanks
>
> Best Regards , Vincent
>-- End of excerpt from Vincent PAROUX Stagiaire ENIB




-- 

		|  NOAA/PMEL               |  ph. (206) 526-6080  
Steve Hankin	|  7600 Sand Point Way NE  |  FAX (206) 526-6744
		|  Seattle, WA 98115-0070  |  hankin@pmel.noaa.gov


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement