By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,113 Members | 996 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,113 IT Pros & Developers. It's quick & easy.

importing excel worksheet

P: n/a
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

Dec 23 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
In article <11**********************@h40g2000cwb.googlegroups .com>,
<14******@sun.ac.zawrote:
>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
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Dec 23 '06 #2

P: n/a
14******@sun.ac.za 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".

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Dec 23 '06 #3

P: n/a
14******@sun.ac.za wrote:
>
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.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

Dec 23 '06 #4

P: n/a

"Richard Heathfield" <rj*@see.sig.invalidwrote in message
news:rv******************************@bt.com...
14******@sun.ac.za 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".
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.
--
www.personal.leeds.ac.uk/~bgy1mm
freeware games to download.
Dec 23 '06 #5

P: n/a
On 23 Dec 2006 13:14:20 GMT, in comp.lang.c , ri*****@cogsci.ed.ac.uk
(Richard Tobin) wrote:
>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 -
news:microsoft.public.excel.sdk
..

--
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
Dec 23 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.