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.
> I have some netcdf files which have data in them and were apparently not > properly closed. When I examine them using ncdump they report zero data > points, although the size is a few meg. > Is there a way of recovering them ? I have looked up the netcdf web page > but couldn't find anything obvious. > Thanks, > Karishma You can use an editor which allows you to change binary files, such as emacs, to correct the 'number of records' in the file. This is a bigendian 4 byte integer which begins at the 4th byte in the file. This is what the first eight bytes would look like in emacs if you had zero records: CDF^A^@^@^@^@ and this is what it would like if you had 6 records (^F is ascii 6) CDF^A^@^@^@^F See Appendix B of the netcdf user's guide for more info. -glenn