Write a string to hdf5 file with defined string length
I am trying to write a string to hdf5 file:
h5create(‘combo.hdf5′,’/description’,1,Datatype=’string’);
h5write(‘combo.hdf5′,’/description’,"this is the description");
When I read it out using h5disp, the result is:
Dataset ‘description’
Size: 1
MaxSize: 1
Datatype: H5T_STRING
String Length: variable
Padding: H5T_STR_NULLTERM
Character Set: H5T_CSET_UTF8
Character Type: H5T_C_S1
ChunkSize: []
Filters: none
FillValue: ”
Notice the String Length is denoted as ‘variable’. What if I want to define the length of this string (23 here), so it shows:
String Length: 23
Thank you very much!I am trying to write a string to hdf5 file:
h5create(‘combo.hdf5′,’/description’,1,Datatype=’string’);
h5write(‘combo.hdf5′,’/description’,"this is the description");
When I read it out using h5disp, the result is:
Dataset ‘description’
Size: 1
MaxSize: 1
Datatype: H5T_STRING
String Length: variable
Padding: H5T_STR_NULLTERM
Character Set: H5T_CSET_UTF8
Character Type: H5T_C_S1
ChunkSize: []
Filters: none
FillValue: ”
Notice the String Length is denoted as ‘variable’. What if I want to define the length of this string (23 here), so it shows:
String Length: 23
Thank you very much! I am trying to write a string to hdf5 file:
h5create(‘combo.hdf5′,’/description’,1,Datatype=’string’);
h5write(‘combo.hdf5′,’/description’,"this is the description");
When I read it out using h5disp, the result is:
Dataset ‘description’
Size: 1
MaxSize: 1
Datatype: H5T_STRING
String Length: variable
Padding: H5T_STR_NULLTERM
Character Set: H5T_CSET_UTF8
Character Type: H5T_C_S1
ChunkSize: []
Filters: none
FillValue: ”
Notice the String Length is denoted as ‘variable’. What if I want to define the length of this string (23 here), so it shows:
String Length: 23
Thank you very much! hdf5, string length, define MATLAB Answers — New Questions