Converting hdf5 to csv or tsv files

前端 未结 5 1570
情话喂你
情话喂你 2021-01-02 07:20

I am looking for a sample code which can convert .h5 files to csv or tsv. I have to read .h5 and output should be csv or tsv.

Sample code would be much appreciated,p

5条回答
  •  盖世英雄少女心
    2021-01-02 07:37

    You can also use h5dump -o dset.asci -y -w 400 dset.h5

    • -o dset.asci specifies the output file
    • -y -w 400 specifies the dimension size multiplied by the number of positions and spaces needed to print each value. You should take a very large number here.
    • dset.h5 is of course the hdf5 file you want to convert

    This converts it to an ascii file, which is easy imported to excel, from where you can easily save it as a .csv (save as within excel, and specify file format). I did it a couple of times, and it worked for me. source

提交回复
热议问题