NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: [netcdfgroup] ASCII to NetCDF (spazm)

On the web you can find the source code for a program called tbl2cdf.
I find this program useful for putting columnar data in netCDF format.
Here's an example of how I use it to skip the header and then
put three columns of ice core data into a file

fl_stb='icr_JRI_dst_lac_1831_1992'
fl_src="${HOME}/icr/${fl_stb}.txt"
fl_tmp="/tmp/${fl_stb}.txt"
fl_hdr="/tmp/${fl_stb}.hdr"
fl_nc="${DATA}/icr/${fl_stb}.nc"
cat > ${fl_hdr} << EOF
time:f cnc_dst_ngxg:f cnc_lac_ngxg:f
EOF
tail --lines=+2 ${fl_src} > ${fl_tmp}
tbl2cdf -h ${fl_hdr} ${fl_tmp} ${fl_nc}

hope this helps,
charlie



  • 2011 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: