importing excel worksheet

1

14276674

I wrote a program in C that implemens a database. Now I want to
upgrade the program so the user can import an excel worksheet and not
have to fill in the entire database. How do you import data from an
excel worsheet using C.

Thanx
 
R

Richard Tobin

I wrote a program in C that implemens a database. Now I want to
upgrade the program so the user can import an excel worksheet and not
have to fill in the entire database. How do you import data from an
excel worsheet using C.

You could find out the format of Excel files, if that information is
publically available, and write code to read it. But you might find
it easier to export your Excel data in some more straightforward
format, such as comma-separated files.

Alternatively, it's possible that some other project such as Open
Office already has code that you could re-use, but I suspect you would
need a lot of supporting infrastructure for that.

-- Richard
 
R

Richard Heathfield

(e-mail address removed) said:
I wrote a program in C that implemens a database. Now I want to
upgrade the program so the user can import an excel worksheet and not
have to fill in the entire database. How do you import data from an
excel worsheet using C.

C has no special magic functions for reading Excel worksheets, but it does
have the ability to open files and read data from them. How you interpret
the data you read is between you and Excel, really. But here's a hint -
whilst the Excel file format is quite scary for a beginner, Excel is
perfectly capable of exporting .csv files (basically text, which is easy to
parse); you might want to explore that avenue first, before you get right
down in the dirty of "structured storage".
 
C

CBFalconer

I wrote a program in C that implemens a database. Now I want to
upgrade the program so the user can import an excel worksheet and
not have to fill in the entire database. How do you import data
from an excel worsheet using C.

By asking in a newsgroup that knows about excel. It probably has
windows or microsoft in its name somewhere.

Alternative, by writing a C program that includes fopen. What it
does after that is up to you.
 
M

Malcolm

Richard Heathfield said:
(e-mail address removed) said:


C has no special magic functions for reading Excel worksheets, but it does
have the ability to open files and read data from them. How you interpret
the data you read is between you and Excel, really. But here's a hint -
whilst the Excel file format is quite scary for a beginner, Excel is
perfectly capable of exporting .csv files (basically text, which is easy
to
parse); you might want to explore that avenue first, before you get right
down in the dirty of "structured storage".
And if you go to the Fuzzy Logic trees section of my website, you will find
a file called csv.c and its associated header which will do all the awkward
work for you.
 
M

Mark McIntyre

You could find out the format of Excel files, if that information is
publically available, and write code to read it.

Its offtopic here but there's a freely-downloadable toolkit from MS
and an entire newsgroup dedicated to it -
..

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top