473,406 Members | 2,369 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

importing excel worksheet

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
5 3822
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
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
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

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
7
by: Darren | last post by:
I have been attempting to create a reservation planning form in excel that imports Data from an Access database and inserts that information automaticly into the correct spreed sheet and the...
2
by: Bill Agee | last post by:
I am having difficulting importing an Excel spreadsheet into my Access program using VBA I want to use the last argument to specify the worksheet name which is RTA. I get an error which says that...
2
by: packwood | last post by:
I have the following code that imports from an Excel workbook but I need to know the worksheet name. If I always want to import from just the first worksheet in the collection how can I do this? ...
9
by: jillandgordon | last post by:
I am trying to import an excel file into Access 97. It looks perfectly all right but, every time I try to import it, I get to the lst step and am told that it was not imported due to an error. ...
0
by: optimizeit | last post by:
What I am attempting to do is import an Excel Workbook and display the worksheets in a datagrid dynamically. I am very close to getting this to work. I have to this point successfully imported a...
1
by: madeleine.macphail | last post by:
All I'm currently attempting to move us from a spreadsheet based system to a database system. The first phase is to import the data on a regular basis from the spreadsheets to get the database...
2
by: jereviscious | last post by:
Hi all - Last resort time. I'm importing data from a spreadsheet that I receive from one of my vendor using interop.excel. The date field in excel is entered as 4/7/2006, but when I retrieve...
0
by: Anish G | last post by:
Hi All, I am getting the below given error while running my application in live server. In my local machine, its working fine. Please help me as it is very urgent for me. Exception from...
2
anoble1
by: anoble1 | last post by:
I have a button in my database that when you hit tit, it imports just 1 excel sheet and puts it in a table. Works great. I am wanting to grab 4 more excel sheets from different locations and store...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.