[ncl-talk] new variables from rows

Damjan Jelić damjan.jelic at fmf.uni-lj.si
Fri Jul 21 08:50:07 MDT 2017


Dear NCL support,

i have txt files (attached) containing 35 different variables which im 
trying to save in netcdf format. current problem is that i need to 
specify every variable on its own and it is not elegant (attached) and 
later on it will be problem since columns will be rearranged in random 
order from time to time.
Can it be done somehow like this:
.data=asciiread(...
....
variable_5 = (str_get_field(data(1::),5,","))
print(variable_5(0)); which is variable name of column 5
print(variable_5(0))=variable_5(3:end)

or in written form:
i load data, ignore first row,
read data by columns
use first row as new variable name
use second row tu set units
skip 3. row and use all the rest as data.

Kind regards,
Damjan

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: TOA5_STUP_10s_5.dat
Url: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170721/eec21a78/attachment.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ncl_stup_10s.ncl
Url: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170721/eec21a78/attachment-0001.pl 


More information about the ncl-talk mailing list