[ HDF5 High Level Tutorial Top ] [ Next ] [ Prev ]

H5TB: HDF5 Table
Tables

Write and read fields by index

Individual fields can also be written by specifying their indexes. To overwrite fields of a table by index we use the H5TBwrite_fields_index function. This function overwrites one or several fields by specifying their indexes and a start record and the number of records to write.. In the example, we overwrite the field Pressure, writing 3 records starting at record 2 by calling

H5TBwrite_fields_index( file_id, "Table1", nfields, field_index_pre, 2, 3, dst_size, dst_offset, pressure_in );

Note that this function, as compared to H5TBread_fields_name, has one extra parameter, nfields, that specifies the number of fields to write. This value is also the dimension of the array pressure_in. To read individual fields by index we use the function. In the example

H5TBread_fields_index( file_id, "Table1", nfields, field_index_pre, 2, 3, dst_size, dst_offset, pressure_out );

Programming Example

The following C program provide an example of how to overwrite fields of a table, by specifying the field indexes. The corresponding HDF5 file that is generated is also referenced here. You can use an HDF5 file browser to access this file by clicking on the link below.

NOTE: To download a tar file of all of the examples, including a Makefile, please go to the Index page.


HDF Help Desk
Last modified: November 18, 2002