importing excel worksheet

Discussion in 'C Programming' started by 14276674@sun.ac.za, Dec 23, 2006.

  1. Guest

    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, 2006
    #1
    1. Advertising

  2. In article <>,
    <> 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.
     
    Richard Tobin, Dec 23, 2006
    #2
    1. Advertising

  3. 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.
     
    Richard Heathfield, Dec 23, 2006
    #3
  4. CBFalconer Guest

    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>
     
    CBFalconer, Dec 23, 2006
    #4
  5. Malcolm Guest

    "Richard Heathfield" <> wrote in message
    news:...
    > 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.
     
    Malcolm, Dec 23, 2006
    #5
  6. On 23 Dec 2006 13:14:20 GMT, in comp.lang.c ,
    (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
     
    Mark McIntyre, Dec 23, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. harshan
    Replies:
    0
    Views:
    540
    harshan
    Jul 20, 2004
  2. =?Utf-8?B?U2hhbyBZb25n?=

    How to delete an Excel worksheet by using ASP.NET?

    =?Utf-8?B?U2hhbyBZb25n?=, May 10, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    1,171
    Martin Dechev
    May 12, 2004
  3. Barbara Vernaeve

    POI HSSF generate 2nd excel worksheet.

    Barbara Vernaeve, Feb 1, 2005, in forum: Java
    Replies:
    0
    Views:
    580
    Barbara Vernaeve
    Feb 1, 2005
  4. Replies:
    1
    Views:
    312
    Mirco Wahab
    Apr 17, 2007
  5. Katja
    Replies:
    1
    Views:
    238
Loading...

Share This Page