I would like to know how to put a line break in below HDF5 attribute string.
DescType_id = H5T.copy ('H5T_C_S1');
H5T.set_size (DescType_id, numel(description));
H5T.set_strpad(DescType_id,'H5T_STR_NULLTERM');
DescAttr_id = H5A.create (g2id, 'description', DescType_id, ...
STimeSpace, 'H5P_DEFAULT');
H5A.write (DescAttr_id, DescType_id, description);
H5T.close(DescType_id);
H5A.close(DescAttr_id);
My description variable would be:
description="Experiment:\nID: 1234\nLocation: London"
I am expecting the line break character to be something like '\n' in above code. Expected Output:
Group '/'
Group '/G1'
Attributes:
'description': 'Experiment:
ID: 1234
Location: London'
Your help is greatly appreciated. Thanks.