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



  • 2011 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: