Solved

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

Posted on 2004-04-19
8
210 Views
Last Modified: 2010-04-15
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
0
Comment
Question by:Bohne
8 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 10859076
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
 
LVL 45

Expert Comment

by:Kdo
ID: 10859078
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
 
LVL 12

Accepted Solution

by:
stefan73 earned 125 total points
ID: 10859101
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
 
LVL 45

Expert Comment

by:Kdo
ID: 10859135

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:Bohne
ID: 10859188
... I have no C++, my proc only supports C. Is there a prebuilt function available?
0
 
LVL 2

Expert Comment

by:anupvijay
ID: 10859281
0
 
LVL 12

Expert Comment

by:stefan73
ID: 10859715
Bohne,
Parsing CSV would be a nice beginner's task for lex. Especially all the quote and newline handling...

Stefan
0
 
LVL 11

Expert Comment

by:avizit
ID: 10861993
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

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now