Convert the HDF5 file to other formats

I have several sets of large HDF5 files, and I'm looking for an efficient way to convert data into these files in XML, TXT, or some other easy-to-read format. I tried to work with the Python package (www.h5py.org), but I was not able to figure out any methods with which I can get this material quickly enough. I am not limited to Python and can also code in Java, Scala or Matlab. Can someone give me some advice on how to do this?

Thanks,

TM

+7
python hdf5 h5py
source share
2 answers

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

  • -o dset.asci indicates the output file
  • -y -w 400 indicates the dimension size multiplied by the number of positions and spaces needed to print each value. Here you have to take a lot.
  • dset.h5 is of course the hdf5 file you want to convert

I think this is the easiest way to turn it into an ascii file, which you can import to succeed or whatever. I did this a couple of times and it worked for me. I received information from this website.

+4
source share

The Mathias711 method is the best direct way. If you want to do this in python use pandas.HDFStore:

 from pandas import HDFStore store = HDFStore('inputFile.hd5') store['table1Name'].to_csv('outputFileForTable1.csv') 
+5
source share

All Articles