Creating New Tables: h5newTableΒΆ
h5newTable creates a new HDF5 table. Table creation can be customized via a creation property list.
Excel UDF Syntax
h5newTable(filename, tablename, heading)
h5newTable(filename, tablename, heading [, properties])
Mandatory Arguments
Argument | Description |
---|---|
filename | A text string specifying the name of an HDF5 file. If the file doesn’t exist, it will be created. |
tablename | A text string (path) specifying the location of the HDF5 table. Missing intermediate groups will be created automatically. Existing table will not be overwritten. |
heading | A text string specifying the column names and types as a list of comma-separated Name,Type pairs. Comma characters in field names must be scaped by a backslash \ character. Restrictions on the field types apply. See Supported Types. |
Optional Arguments
Argument | Description |
---|---|
properties | A text string that is formatted as a list of comma-separated pairs of Name,Value arguments. See the Properties section for the supported keywords and value ranges. Unrecognized names (and their values) will be ignored. |
Properties
Name | Description | Values | Default |
---|---|---|---|
Chunksize | Defines the chunk size for the table. | A positive integer. positive integers | Auto. |
Deflate | Enables GZIP compression sets level. | (0-9) | 0 (no compression) |
Fletcher32 | Enable Fletcher32 checksum generation for the array. | Boolean | false |
Return Value
On success, h5newTable returns tablename (string).
On error, an error message (string) is returned.
Examples
Create a table with a single column of unsigned integers. Note that the column name contains a comma character and needs to be escaped by \.
h5newTable("sample.h5", "/My/new/HDF5 table", "City\, State,uint8")
Create a table with 5 columns of different types.
h5newTable("sample.h5", "/table2", \
"City\, State,uint8,x,double,y,double,A\, B,int16,v,single[2]")
Create a table with four columns and control the chunk size (= 128 rows), the compression level (= 6), and enable Fletcher32 checksum generation.
h5newTable("sample.h5", "/table3", \
"Howdy,string,x,double,y,double,v,single[3]", \
"Chunksize,128,Deflate,6,Fletcher32,true")
Error Conditions
The following conditions will create an error:
- An invalid file name
- An empty string or a string that contains characters not supported by the operating system
- It refers to a file system location for which the user has insufficient access privileges.
- It refers to a read-only file.
- An invalid table name
- An empty string
- An HDF5 object exists at the specified location
- Missing intermediate groups cannot be created.
- An invalid heading
- An empty string or a string which is not formatted as a comma-separated list
- A (non-escaped) comma separated list with an odd number of elements
- An invalid or unsupported datatype or fill value specification
- Invalid properties
- A string which is not formatted as a comma-separated list
- A comma separated list with an odd number of elements
- A value which is outside the admissible range for the corresponding key
See Also