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 Emma, Sorry to have taken so long to respond to your question. > I'm currently in the process of converting a netcdf file into a text > file in Ubuntu. I want to just select one of the variables to import > into the text file and have followed the following command : ncdump -v > wspd -p 3 foo.nc > > This command worked fine but my question is how do I change just this > variable into a text file rather then the file as a whole? > > Any advice would be greatly appreciated. ncdump always produces valid CDL as output, so that it can be used as input to the ncgen tool, which is sort of the inverse of ncdump. That's why ncdump can't just output the data for a variable. However, there are other tools and approaches that could be used, for example, see the answer to this frequently asked question: How do I convert netCDF data to ASCII or text? http://www.unidata.ucar.edu/software/netcdf/docs/faq.html#converttotext I hope that helps. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: HDH-152161 Department: Support netCDF Priority: Emergency Status: Closed