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.
>To: address@hidden >From: "Marc V. Gorenstein" <address@hidden> >Subject: ASCII to AIA >Organization: . >Keywords: 199904222041.OAA26052 Hi Marc, > Is there a utility that will take a column of data in ASCII format and > translate to netCDF or AIA format? Yes, there's the tbl2cdf program from our "User Contributed netCDF Software" page at http://www.unidata.ucar.edu/packages/netcdf/contrib.html tbl2cdf.c Chuck Denham's program to convert a flat ASCII table to a netCDF file. The program scans a flat ASCII table for the name and most general data type of each column. It then creates and populates a netCDF file with the data. You can click on the link on that page or get the source from ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/tbl2cdf.c Using "ncgen" with the "-b" option is another pretty quick way to generate a netCDF file, say data.nc, from ASCII data, by editing a CDL file, say data.cdl, that contains the ASCII data delimited by commas and using that as input to ncgen $ ncgen -b -o data.nc data.cdl I've appended a small example of a CDL file that shows what's needed ... --Russ _____________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu netcdf foo { dimensions: nx=10; variables: float var(nx); data: var = 0, 10, 20, 30, 40, 50, 60, 70, 80, 90; }