commas in variable name

Hi there,

I'm trying to dump one SDS into an ascii file using the following command:

hdp dumpsds -n "Daily Avg, Tot-Sky, Sfc Net LW Flux - Mod B" -d -o

test_var.dat file_name.hdf

but I'm getting these errors:

SDS with name 'Daily Avg': not found
SDS with name ' Tot-Sky': not found
SDS with name ' Sfc Net LW Flux - Mod B': not found

which seem to be due to the commas in my relatively complex variable name
(i.e., "Daily Avg, Tot-Sky, Sfc Net LW Flux - Mod B").

Does anybody know how to get around this problem?

Any help will be greatly appreciated.

Many thanks in advance.
grg

···

--
View this message in context: http://hdf-forum.184993.n3.nabble.com/commas-in-variable-name-tp4024208.html
Sent from the hdf-forum mailing list archive at Nabble.com.

Hello!

This format appears to work:
    hdp dumpsds -n 'xxx xxx','zzz zzz' -d file.hdf >& file.txt

Could you try that?

I tried it with a file I found and it worked for me:

$ hdp dumpsds -n 'CO Profiles Percent Apriori Day' -d MOP03M.hdf > & mop1.txt
$ hdp dumpsds -n 'CO Profiles Percent Apriori Night' -d MOP03M.hdf >& mop2.txt
$ hdp dumpsds -n 'CO Profiles Percent Apriori Day','CO Profiles Percent Apriori Night' -d MOP03M.hdf >& mopboth.txt

$ ls -l mop*.txt
-rw-r--r-- 1 bljones hdf 4923487 May 31 09:06 mop1.txt
-rw-r--r-- 1 bljones hdf 4823103 May 31 09:08 mop2.txt
-rw-r--r-- 1 bljones hdf 9746590 May 31 09:09 mopboth.txt

-Barbara

···

On Wed, 30 May 2012, gdal wrote:

Hi there,

I'm trying to dump one SDS into an ascii file using the following command:

hdp dumpsds -n "Daily Avg, Tot-Sky, Sfc Net LW Flux - Mod B" -d -o

test_var.dat file_name.hdf

but I'm getting these errors:

SDS with name 'Daily Avg': not found
SDS with name ' Tot-Sky': not found
SDS with name ' Sfc Net LW Flux - Mod B': not found

which seem to be due to the commas in my relatively complex variable name
(i.e., "Daily Avg, Tot-Sky, Sfc Net LW Flux - Mod B").

Does anybody know how to get around this problem?

Any help will be greatly appreciated.

Many thanks in advance.
grg

--
View this message in context: http://hdf-forum.184993.n3.nabble.com/commas-in-variable-name-tp4024208.html
Sent from the hdf-forum mailing list archive at Nabble.com.

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Barbara Jones
bljones@hdfgroup.org

Hi Barbara,

it does not work.

If I issue:

hdp dumpsds -n "Daily Avg, Tot-Sky, Sfc Net LW Flux - Mod B" -d
file_name.hdf > test_var.dat

I simply get the same error messages in the file test_var.dat

The problem is that "Daily Avg, Tot-Sky, Sfc Net LW Flux - Mod B" is the
name of a single variable, but hdp interprets it as a list of three
different variables separated by commas.

Any idea?

Many thanks for your time.

Cheers,
Giorgio

···

--
View this message in context: http://hdf-forum.184993.n3.nabble.com/commas-in-variable-name-tp4024208p4024508.html
Sent from the hdf-forum mailing list archive at Nabble.com.

Hello Giorgio,

it does not work.

If I issue:

hdp dumpsds -n "Daily Avg, Tot-Sky, Sfc Net LW Flux - Mod B" -d
file_name.hdf > test_var.dat

I simply get the same error messages in the file test_var.dat

The problem is that "Daily Avg, Tot-Sky, Sfc Net LW Flux - Mod B" is the
name of a single variable, but hdp interprets it as a list of three
different variables separated by commas.

Any idea?

Ah! I misunderstood. This looks like it could be a bug in hdp.
(I don't see how to escape the comma, which is the names delimiter for the -n option; I'll verify that.)

A workaround is to rename the SDS and get rid of the commas. I have attached a simple C program that will allow you to do that. (Be sure
to make a copy of your file before doing this!)

In the C program, change:

  FILENAME to your HDF file name
  DNAME to "Daily Avg, Tot-Sky, Sfc Net LW Flux - Mod B"
  NEWDNAME to "Daily Avg Tot-Sky Sfc Net LW Flux - Mod B"

Will that work for you?

-Barbara

sd-chgname.c (1.18 KB)

Hi Barbara,

Sorry for the long delay.
Yes, it works.

Many thanks!

Giorgio

···

On 31/05/12 17:36, Barbara Jones wrote:

Hello Giorgio,

it does not work.

If I issue:

hdp dumpsds -n "Daily Avg, Tot-Sky, Sfc Net LW Flux - Mod B" -d
file_name.hdf > test_var.dat

I simply get the same error messages in the file test_var.dat

The problem is that "Daily Avg, Tot-Sky, Sfc Net LW Flux - Mod B" is the
name of a single variable, but hdp interprets it as a list of three
different variables separated by commas.

Any idea?

Ah! I misunderstood. This looks like it could be a bug in hdp.
(I don't see how to escape the comma, which is the names delimiter for
the -n option; I'll verify that.)

A workaround is to rename the SDS and get rid of the commas. I have
attached a simple C program that will allow you to do that. (Be sure
to make a copy of your file before doing this!)

In the C program, change:

FILENAME to your HDF file name
DNAME to "Daily Avg, Tot-Sky, Sfc Net LW Flux - Mod B"
NEWDNAME to "Daily Avg Tot-Sky Sfc Net LW Flux - Mod B"

Will that work for you?

-Barbara

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
____________________________
Giorgio Dall'Olmo
Plymouth Marine Laboratory
Prospect Place
The Hoe
Plymouth
PL1 3DH
UK

phone: +44-(0)1752-633429
   fax: +44-(0)1752-633101