简体   繁体   中英

How to extract text from TextView type of H5 file?

I have an H5 file with following structure:

在此处输入图像描述

How do I import the text that is in "description" which is of type TextView into a variable using python?

Have you read h5py documentation? Have you tried to code anything?

Not sure what type TextView is. How did you determine the type?

cc , bb and aa are HDF5 Groups.
description is a HDF5 Dataset.

You can access the description dataset with the following:

import h5py
with h5py.File('SRCatalogue.h5') as h5f:
    # This returns an h5py dataset object as descr
    descr = h5f['/cc/bb/aa/descripton']
    # Add this to get info about the data:  
    print(descr.shape, descr.dype)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM