converting a large number of excel files into a single mysql table - c++

I am using microsoft visual studio 10 c++ and mysql workbench.I have a large number of excel files and i want to update the content of all excel files into a single mysql table.I can create a csv file for each excel file and then import it but i want it to be done with the help of a stored procedure.I want to use c++.And this procedure has to be repeated with different excel files.
i was thinking of connecting my c++ program to both excel and mysql simultaneously(is it possible?) and reading the excel files and adding the data into the mysql table.
i have already connected my program to mysql database.
Any other approach would be appreciated.

In MySQL Store Procedure it will not accept bulk load or CSV import But You can use without SP. Better Try to import using C++.

Related

How do you convert hdf5 files into a format that is readable by SAS Enterprise Miner(sas7bdat)

I have a subset of the data set called as 'million song dataset' available on the website (http://labrosa.ee.columbia.edu/millionsong/) on which I would like to perform data mining operations on SAS Enterprise Miner (13.2).
The subset I have downloaded contains 10,000 files and they are all in HDF5 format.
How do you convert hdf5 files into a format that is readable by SAS Enterprise Miner(sas7bdat)
On Windows there is an ODBC driver for HD5. If you have SAS/ACCESS ODBC then you can use that to read the file.
I don't think it's feasible to do this directly, as hdf5 seems to be a binary file format. You might be able to use another application to convert hdf5 to a plain text format and then write SAS code to import that.
I think some of the other files on this page might be easier to import:
http://labrosa.ee.columbia.edu/millionsong/pages/getting-dataset

Reading the cells of an excel sheet in c++

In one of my program, I'm suppose to parse an excel sheet using C++ programming. I'm not suppose to use any third party tool. So, please let me know the code to parse excel sheet and read rows and columns of an selected excel sheet. Thanks in advance.
In order to read excel files you need some external tool like MS - Office Library. Why don't you export excel to CSV (Comma Seperated File) File->Save as->CSV(Comma Delimited).
Then you can read it just like normal txt file. You can open and edit just like worksheet in MS-Excel.
You can COM to access Excel; for an example, see http://www.wilmott.com/messageview.cfm?catid=10&threadid=26137 (from this question)
However to will probably be easier to use C++/CLI as a wrapper and access COM from .NET.

Sahi OpenSource to store data from web application and to open office

I am new to automation. I am trying to fetch data from an application and store it in excel format. It can be done using Ms Excel but can the same be done by using Open Office?
I am using Sahi OpenSource
When you are storing a data in some excel file, it doesn't matters whether you store it from Ms Excel or open office. You have the excel or csv file to which Sahi will write directly. You can write to excel files or csv files or text file even from Sahi. I would encourage you to look at sahi documentation regarding writing to files.

Store MySQL table to file (sqlite?)

I wrote a C++/QT application that uses a mysql database for its data. It's using the mysql++ library. I now want it to be able to export and import its data to/from files.
I could write an own file format, but I'd like to elude this efford, if possible.
Is there an easy possibility to export a mysql table into a file and to reimport this file with C++?
I heard of sqlite, but as far as I read, migrating from mysql++ to sqlite is not that easy, because it includes a switch of the complete database backend.
You can use "LOAD DATA " and "SELECT ... INTO OUTFILE"
That should have great performance. You may not use the outfiles further as easily as you want.
The best way to export/import data from/to a database is xml files.

Programmatically creating Excel file in C++

I have seen programs exporting to Excel in two different ways.
Opening Excel and entering data cell by cell (while it is running it looks like a macro at work)
Creating an Excel file on disk and writing the data to the file (like the Export feature in MS Access)
Number 1 is terribly slow and to me it is just plain aweful.
Number 2 is what I need to do. I'm guessing I need some sort of SDK so that I can create Excel files in C++.
Do I need different SDKs for .xls and .xlsx?
Where do I obtain these? (I've tried Googling it but the SDKs I've found looks like they do other things than providing an interface to create Excel files).
When it comes to the runtime, is MS Office a requirement on the PC that needs to create Excel files or do you get a redistributable DLL that you can deploy with your executable?
You can easily do that by means of the XML Excel format. Check the wikipedia about that:
http://en.wikipedia.org/wiki/Microsoft_Excel#XML_Spreadsheet
This format was introduced in Excel 2002, and it is an easy way to generate a XLS file.
You can also try working with XLS/XLSX files over ODBC or ADO drivers just like databases with a limited usage. You can use some templates if you need formatting or create the files from stratch. Of course you are limited by playing with the field values that way. For styling etc. you will need to use an Excel API like Microsoft's.
I'm doing this via Wt library's WTemplate
In short, I created the excel document I wanted in open office, and save-as excel 2003 (.xml) format.
I then loaded that in google-chrome to make it look pretty and copied it to the clipboard.
Now I'm painstakingly breaking it out into templates so that Wt can render a new file each time.