Re: How to remove an NcVar?

Håkon Groven a écrit :
> Hi!
>
> I am using the c++ api and I am looking for an easy way to remove an
> NcVar with all its data.
> I cannot find any function like the NcAtt::remove for instance.
>
> Can anybody help?
>
> Best wishes Haakon
You cannot.
Unlike attributes, while a variable is created it cannot be
removed, just renamed (for dimensions too).
The only way to remove a variable is to make a copy of the
file without this variable.


You can do it simply (if you don't want to create a program
to do this) with the netcdf operators (NCO). For example:
ncecat -x -v VarToRemove InputFile.nc OutputFile.nc


==============================================================================
To unsubscribe netcdfgroup, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================