Solved

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

Posted on 2004-04-19
8
214 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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:Kent Olsen
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 45

Expert Comment

by:Kent Olsen
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
 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
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 opening and reading files in the C programming language.

733 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