NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

Re: [netcdfgroup] ncdump with just the variable's values?

Hi Chris,

> Is there a way to get ncdump to output just the values of a given variable?  
> (The -v option gives me the header info as well.)

No, but this works pretty well, if you want to print just the values of
var1 and var2 from netCDF file foo.nc:

  ncdump -v var1,var2 foo.nc | sed -e '1,/data:/d' -e '$d'

It eliminates all the header info and the last line that's just "}".
It doesn't work for netCDF-4 files that have nested groups.

--Russ