Solved

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

Posted on 2004-04-19
8
211 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
ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

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…
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…
The goal of this video is to provide viewers with basic examples to understand and use structures 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.

947 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

20 Experts available now in Live!

Get 1:1 Help Now