NSF Unidata

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

[netCDFJava #IQO-583790]: Copy NetCDF file

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.



Hi Chad,

sorry for the slow reply.
You can copy one file to another using the FileWriter2 class:
http://www.unidata.ucar.edu/software/netcdf-java/v4.3/javadoc/ucar/nc2/FileWriter2.html
 
You have to create the FileWriter2 object first:

NetcdfFile ncFileIn = NetcdfFile.open(fileIn);
FileWriter2 writer = new ucar.nc2.FileWriter2( ncFileIn, fileInOut, version, 
null);

and then just call the method write:
NetcdfFile ncFileOut = writer.write()

Hope it helps!

Ticket Details
===================
Ticket ID: IQO-583790
Department: Support netCDF Java
Priority: Urgent
Status: Open