• C

What is the easiest way to read values out of a excel file in C?

Hi,

I have an array of float values in Excel. What is the easiest way to read these values in C? I could also save it as a comma delimited text-file... what do you suggest?


thanks
BohneAsked:
Who is Participating?
 
stefan73Connect With a Mentor Commented:
Hi Bohne,
Use CSV and check
http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_20914779.html

CSV is harmless to parse.

Cheers,
Stefan
0
 
AlexFMCommented:
Reading of values directly from Excel file requires using of Automation. This is COM technology which is no compatible with C (only C++). So, read from text file.
0
 
Kent OlsenData Warehouse Architect / DBACommented:
Hi Bohne,

Saving the spreadsheet as a comma-delimited file is by far the easiest.  Otherwise you need to understand all of the Excel data formats, which can change between releases.

If you're coding in C++ (a different problem...) there are APIs/libraries already out there to read the spreadsheet.


Good Luck,
Kent
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
Kent OlsenData Warehouse Architect / DBACommented:

Back to C++ for a minute -- Both Borland and MS have had the APIs built into their C++ libraries for at least 4 years.

Kent

0
 
BohneAuthor Commented:
... I have no C++, my proc only supports C. Is there a prebuilt function available?
0
 
stefan73Commented:
Bohne,
Parsing CSV would be a nice beginner's task for lex. Especially all the quote and newline handling...

Stefan
0
 
avizitCommented:
If you just want tp read /write excel files and aren't really concerned which language you are using then i would suggest suing perl
there are many modules which are already present to handle excel files

http://search.cpan.org/search?query=excel&mode=all

/abhijit/
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.