[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #KRR-618779]: Multiple string attribute values in netcdf 3

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.


  • Subject: [netCDF #KRR-618779]: Multiple string attribute values in netcdf 3
  • Date: Mon, 26 Jan 2009 13:12:28 -0700

Hi Patrick,

There is no naming convention for an attribute stored in a variable,
and in netCDF-3 there is no way to store multiple strings in a single
attribute without using some sort of convention for the string
separator.  One widely used convention that is used for the global
"history" convention is to use an embedded newline in the string to
separate string values.  That won't work if your string values can
include newline characters, but otherwise would be OK.  However, the
reading program would have to know about this convention to parse the
multiple string values using the newline separators.

This is one of the benefits of the string primitive type in netCDF-4,
supporting attributes with multiple string values.

--Russ

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: KRR-618779
Department: Support netCDF
Priority: Normal
Status: Closed