Re: numAsciiCol

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu, 31 Jul 2008 09:26:52 -0600 (MDT)

This may not help you, but it's an FYI for folks who have ASCII data
that has columns of different types (float, integer, string, etc)
separated by a delimiter, and want to write it to a netCDF file:

   http://www.ncl.ucar.edu/Applications/ascii_delim.shtml

It assumes that the ASCII file has a single header line that defines
the name of each field. You can get into this file and change as
needed.

--Mary

On Thu, 31 Jul 2008, Dennis Shea wrote:

> As a 'thumb-in-the-dike' solution
>
> NCOL = dimsizes(asciiread(diri+fili, -1,"float"))/numAsciiRow(diri+fili)
>
> print("NCOL="+NCOL)
>
>
>
> Mateus Teixeira wrote:
>> Dear NCL users,
>>
>> I have a file with the following lines:
>>
>> 954,567,20,14,68,10.64,75,12,297.1,328.2,299
>> 942,683,19.7,13.7,68,10.54,75,15,297.9,328.8,299.8
>> 925,851,19.2,13.2,68,10.41,110,12,298.9,329.6,300.8
>> 913,964,19.6,12.6,64,10.13,136,10,300.5,330.5,302.3
>> 871,1367,16.5,11.6,73,9.91,230,4,301.3,330.8,303.1
>> ...
>> ...
>>
>> When I try to get the number of columns of this file with numAsciiCol
>> function, it returns only 1.
>>
>> Does numAsciiCol work only with files with columns separated by blank
>> spaces?
>>
>> Best regards,
>>
>>
>> --
>> Mateus da Silva Teixeira
>> Meteorologista
>> Instituto de Pesquisas Meteorológicas - IPMET (www.ipmet.unesp.br
>> <http://www.ipmet.unesp.br>)
>> Universidade Estadual Paulista - UNESP (www.unesp.br <http://www.unesp.br>)
>> Bauru, SP
>>
>> Registered Linux User #466740
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk_at_ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jul 31 2008 - 09:26:52 MDT

This archive was generated by hypermail 2.2.0 : Thu Jul 31 2008 - 14:58:46 MDT