Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > importing excel worksheet

Reply
Thread Tools

importing excel worksheet

 
 
14276674@sun.ac.za
Guest
Posts: n/a
 
      12-23-2006
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

 
Reply With Quote
 
 
 
 
Richard Tobin
Guest
Posts: n/a
 
      12-23-2006
In article <(E-Mail Removed) .com>,
<(E-Mail Removed)> 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.


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.
 
Reply With Quote
 
 
 
 
Richard Heathfield
Guest
Posts: n/a
 
      12-23-2006
http://www.velocityreviews.com/forums/(E-Mail 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".

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      12-23-2006
(E-Mail Removed) 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>

 
Reply With Quote
 
Malcolm
Guest
Posts: n/a
 
      12-23-2006



"Richard Heathfield" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> (E-Mail 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".
>

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.


 
Reply With Quote
 
Mark McIntyre
Guest
Posts: n/a
 
      12-23-2006
On 23 Dec 2006 13:14:20 GMT, in comp.lang.c , (E-Mail Removed)
(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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make COPY of Worksheet(1) to some other Worksheet ??? Katja Perl Misc 1 01-14-2008 10:26 AM
adding an excel worksheet to a generetad excel file via perl FlorianKraft@gmx.de Perl Misc 1 04-17-2007 12:53 PM
POI HSSF generate 2nd excel worksheet. Barbara Vernaeve Java 0 02-01-2005 04:04 PM
Unable to read particular worksheet from excel file using perl harshan Perl 0 07-20-2004 09:32 PM
How to delete an Excel worksheet by using ASP.NET? =?Utf-8?B?U2hhbyBZb25n?= ASP .Net 5 05-12-2004 08:11 AM



Advertisments