Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
===============================================================================


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690