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.
Mutlu Ozdogan <address@hidden> writes: > Dear Ed, > > linking the netcdf library worked beautifully and the code (i called > foo.c out of ncgen) compiled. Now I have a more fundamental question. > > I understand that one can generate a netCDF file if there is a valid > *.cdl file that includes the data section. Alternatively, one can use > the C code generated out of ncgen to convert a binary file to netCDF > file. However, I noticed that the data (to be put into netCDF file) > is actually stored in the C code as ascii. So my question is how to > get my binary data into the C code as comma delimated ascii so that > the C code can generate the netCDF file. If I had my data in ascii > format to begin with, then I could bring it into a cdl file and run > ncgen on it without the C code generated out of ncgen. When you geta > chance, would you be able to explain to me how to take a regular > multi-date binary files (12 files in my case representing 12 monhly > precipitation data) and convert it a single netCDF file? > > Thank you again for your time. > > Cheers, > > Mutlu.. > Sorry, you've lost me here. What do you mean by CDL file? Seems like you need a C program that reads your data file and converts it to netCDF, correct? Ed -- Ed Hartnett -- address@hidden