Convert HDF5 file to other formats

visakh picture visakh · Apr 23, 2014 · Viewed 11.3k times · Source

I am having a few big files sets of HDF5 files and I am looking for an efficient way of converting the data in these files into XML, TXT or some other easily readable format. I tried working with the Python package (www.h5py.org), but I was not able to figure out any methods with which I can get this stuff done fast enough. I am not restricted to Python and can also code in Java, Scala or Matlab. Can someone give me some suggestions on how to proceed with this?

Thanks,

TM

Answer

Ramón J Romero y Vigil picture Ramón J Romero y Vigil · Apr 23, 2014

Mathias711's method is the best direct way. If you want to do it within python, then use pandas.HDFStore:

from pandas import HDFStore

store = HDFStore('inputFile.hd5')

store['table1Name'].to_csv('outputFileForTable1.csv')