Project

General

Profile

Convert a text file to netcdf

Added by Adoum Mahamat about 10 years ago

Hi,
I have a text file organized like that:

lon lat PressureLevel1Temp PressureLevel2Temp PressureLevel3Temp PressureLevel4Temp
128 45 173 210 198 244
100 45 175 176 144 234
122 45 175 188 198 222
131 45 173 197 144 212
123 45 183 199 198 211
.......
......

I want to convert this file to netcdf format.
Please Help me.
Thanks


Replies (1)

RE: Convert a text file to netcdf - Added by Ralf Hand about 10 years ago

Hi,

I'm not sure, if there is any possibility to do this with cdo. I would use the netcdf Operators (NCO) for this purpose instead. See here for details and download:

http://nco.sourceforge.net/

Installing this package will offer you a selection of shell based commands for basic operations on netcdf files. ncdump anynetcdffile will dump the content of a netcdf file to stdout. If you rearrange your data in the same manner, store it in anyfile.ascii and then do "ncgen -o out.nc < anyfile.ascii", you would get what you want.

regards,
Ralf

    (1-1/1)