How can I convert a flat CSV file to a HDF5 file

Dear HDF5 Users,
Please I have comma separated value (CSV) file that is in a tabular format and I can open it in MS Excel. I want to just convert this file to a HDF5
file. I am new to HDF5 file, but I cannot see any documentation that
just takes a flat file and converts it to a HDF5.

Kind regards

Hello,

HDFView can import text files. Please see section 5.6 of the HDFView User's Guide http://www.hdfgroup.org/products/java/hdf-java-html/hdfview/UsersGuide/ug05spreadsheet.html#ug05import.

Basics steps are:

1. In the main HDFView menu go to Tools --> User Options. In the "Data" row change Data Delimiter option from Tab to Comma.
2. Open or create a new file and create an empty dataset, then open it. You will get a new window with the default values (0) shown.
3. Go to the "Table" tab and choose "Import Data from Text File".

Make sure you save the changes by closing the file before exiting HDFView.

If you have data separated by tabs or spaces, you can also use h5import http://www.hdfgroup.org/HDF5/doc/RM/Tools.html#Tools-Import.

Elena

···

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Elena Pourmal The HDF Group http://hdfgroup.org
1800 So. Oak St., Suite 203, Champaign IL 61820
217.531.6112
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On Dec 30, 2013, at 12:55 AM, Gokop Goteng goteng1704@yahoo.com wrote:

Dear HDF5 Users,
Please I have comma separated value (CSV) file that is in a tabular format and I can open it in MS Excel. I want to just convert this file to a HDF5 file. I am new to HDF5 file, but I cannot see any documentation that just takes a flat file and converts it to a HDF5.

Kind regards
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

Hi Gokap,

If you know Python, it will be easy to write a script that do the job,
using http://docs.python.org/2/library/csv.html and http://www.h5py.org/docs/

----- Mail original -----

···

De: "Gokop Goteng" <goteng1704@yahoo.com>
À: hdf-forum@lists.hdfgroup.org
Envoyé: Lundi 30 Décembre 2013 07:55:40
Objet: [Hdf-forum] How can I convert a flat CSV file to a HDF5 file

Dear HDF5 Users,
Please I have comma separated value (CSV) file that is in a tabular
format and I can open it in MS Excel. I want to just convert this
file to a HDF5 file. I am new to HDF5 file, but I cannot see any
documentation that just takes a flat file and converts it to a HDF5.

Kind regards
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

Hi Elena,
Thanks for your reply. I am already working with C, is there no HDF5 API to just convert dataset in a flat file to HDF5 file using some commands. I have seen that you can use a for loop to write raw data, so why can't I print out the contents of a flat file and the save it in a dataset and then a HDF5?

Kind regards

···

On Monday, December 30, 2013 5:01 PM, David Froger <david.froger@inria.fr> wrote:

Hi Gokap,

If you know Python, it will be easy to write a script that do the job,
using http://docs.python.org/2/library/csv.html and http://www.h5py.org/docs/

________________________________

De: "Gokop Goteng" <goteng1704@yahoo.com>

À: hdf-forum@lists.hdfgroup.org
Envoyé: Lundi 30 Décembre 2013 07:55:40
Objet: [Hdf-forum] How can I convert a flat CSV file to a HDF5 file

Dear HDF5 Users,
Please I have comma separated value (CSV) file that is in a tabular format and I can open it in MS Excel. I want to just convert this file to a HDF5

file. I am new to HDF5 file, but I cannot see any documentation that
just takes a flat file and converts it to a HDF5.

Kind regards
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

Hi Gokop,

···

On Dec 30, 2013, at 1:40 PM, Gokop Goteng <goteng1704@yahoo.com> wrote:

Hi Elena,
Thanks for your reply. I am already working with C, is there no HDF5 API to just convert dataset in a flat file to HDF5 file using some commands. I have seen that you can use a for loop to write raw data, so why can't I print out the contents of a flat file and the save it in a dataset and then a HDF5?

You can use High-Level HDF5 APIs to create and write a dataset in one call, but you will need to read data to a buffer first. See H5LTmake_dataset* functions http://www.hdfgroup.org/HDF5/doc/HL/RM_H5LT.html. See also HL Tutorial and examples http://www.hdfgroup.org/HDF5/Tutor/h5lite.html.

Please make sure to use h5cc compiler script or link with the HL HDF5 C library libhdf5_hl.so(a) that should precede HDF5 C library libhdf5.so(a) on the link line.

Elena
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Elena Pourmal The HDF Group http://hdfgroup.org
1800 So. Oak St., Suite 203, Champaign IL 61820
217.531.6112
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Kind regards

On Monday, December 30, 2013 5:01 PM, David Froger <david.froger@inria.fr> wrote:
Hi Gokap,

If you know Python, it will be easy to write a script that do the job,
using http://docs.python.org/2/library/csv.html and http://www.h5py.org/docs/

De: "Gokop Goteng" <goteng1704@yahoo.com>
À: hdf-forum@lists.hdfgroup.org
Envoyé: Lundi 30 Décembre 2013 07:55:40
Objet: [Hdf-forum] How can I convert a flat CSV file to a HDF5 file

Dear HDF5 Users,
Please I have comma separated value (CSV) file that is in a tabular format and I can open it in MS Excel. I want to just convert this file to a HDF5 file. I am new to HDF5 file, but I cannot see any documentation that just takes a flat file and converts it to a HDF5.

Kind regards

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org