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

[netCDF #CYQ-616331]: Question about netcdf global variables



Hi Janet,

ncdump will print the character since it is part of the embedded metadata; you 
might be able to strip it out by piping it into sed to remove the '\n', but 
unfortunately, there is not an easy way to tell ncdump to not print the 
newline.  To be honest, ncdump is a fairly rudimentary tool, you might take a 
look at NCO (the NetCDF Operators), which are much more advanced, and may be 
able to do what you are looking for.

I'm sorry I can't be of more immediate help, but hopefully this will point you 
in the right direction.

-Ward

> Hello,
> 
> I am creating a netcdf file and I have a question about the
> global variables that I can't find the answer to online.  I have a couple
> of global variables that I would like to separate on different lines in the
> netcdf file.  For example:
> 
> global variable author:  author1: person/institution
> author2: person/institution
> 
> I tried putting "\n" in the global variable.  This works to put the 2nd
> author on the next line, but it leaves the "\n" in the text.  Here is an
> example with the global variable author on one line:
> :author = "author1: UCAR/NCAR - Earth Observing Laboratory author2:
> National Climatic Data Center (NCDC), NOAA" ;
> 
> and the same example with the "\n" in the code to separate into two lines:
> :author = "author1: UCAR/NCAR - Earth Observing
> Laboratory\n",
> "author2: National Climatic Data Center (NCDC),
> NOAA" ;
> 
> Notice the "\n" appears in the text at the end of the author1 line.
> 
> The above examples are from netcdf files I created and the text is from the
> results of the ncdump command.
> 
> Is there another way to separate the global variable into two lines without
> having the "\n" appear in the text?
> 
> Thank you,
> Janet
> 
> 


Ticket Details
===================
Ticket ID: CYQ-616331
Department: Support netCDF
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with NSF Unidata User Support are recorded in the 
Unidata inquiry tracking system and then made publicly available through the 
web.  If you do not want to have your interactions made available in this way, 
you must let us know in each email you send to us.