Page tree


How to convert an HDF4 or HDF5 file to ASCII (text) or Excel

You can use h5dump (HDF5), hdp (HDF4) or HDFView (for both HDF4 and HDF5) to dump data into an ASCII file that can be imported into Excel.

h5dump: (HDF5)
You can convert HDF5 files into ASCII (comma delimited) that can be imported into Excel, without it wrapping the lines. You would use h5dump with the -y and -w options:

   h5dump -o dset.asc -y -w 400 dset.h5

Note that the value that is specified for the -w option must be the dimension size multiplied by the number of positions and spaces needed to print each value. (So be sure to specify a value that is big enough!)

hdp: (HDF4)
You can convert an HDF4 file into an ASCII file (space delimited) that can be imported into Excel, without it wrapping the lines. Use hdp with the -d and -s options. For example:

       hdp dumpsds -s -d -n "data1" sd.hdf > & sd.asc

HDFView: (both)
You can also open an HDF4 or HDF5 dataset with the TableView (spreadsheet) in HDFView, and then select "Export Data to File", to obtain a tab-delimited ASCII file that can be imported into Excel.