coding a csv to xls tool

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mirko

    coding a csv to xls tool

    Hi !

    I am looking for a command line tool which converts csv to xls. A c, c++
    example source for a commandline application, which reads a file, parses
    it, and writes it to another file would be a good help for the first
    step. The source and destination should be given as command line
    arguments. I hope this must be simple and was done million times before.

    If there is a complete source / tool out there and someone knows about
    it, a link or the whole script would be fine.

    Thanks for every advice
    Mirko

  • Thomas Matthews

    #2
    Re: coding a csv to xls tool

    Mirko wrote:
    [color=blue]
    > Hi !
    >
    > I am looking for a command line tool which converts csv to xls. A c, c++
    > example source for a commandline application, which reads a file, parses
    > it, and writes it to another file would be a good help for the first
    > step. The source and destination should be given as command line
    > arguments. I hope this must be simple and was done million times before.
    >
    > If there is a complete source / tool out there and someone knows about
    > it, a link or the whole script would be fine.
    >
    > Thanks for every advice
    > Mirko
    >[/color]

    My understanding is that XLS format is one defined by Microsoft and
    used by the Excel application. Perhaps you would want to search the
    MSDN web site for information about a command line interface to
    Microsoft Excel. Why re-invent the wheel? I know that it can open
    a CSV (Comma separated values) file. Also check if Excel has
    the ability to execute programs or scripts.

    Next time, your best source for these issues is a Microsoft
    newsgroup. See the FAQ and Welcome.txt links below. This newsgroup,
    news:comp.lang. c++, discusses issues about the language, not
    applications of it.

    --
    Thomas Matthews

    C++ newsgroup welcome message:

    C++ Faq: http://www.parashift.com/c++-faq-lite
    C Faq: http://www.eskimo.com/~scs/c-faq/top.html
    alt.comp.lang.l earn.c-c++ faq:

    Other sites:
    http://www.josuttis.com -- C++ STL Library book

    Comment

    • Help_xyz

      #3
      Re: coding a csv to xls tool

      Hello,
      Dont know abt your reqmt clearly,
      but if the target is .xls (excel sheet) then why dont you use the
      features
      in microsoft excel itself which will allow you to get a csv file and
      convert to the xls..


      Mirko <mirko_NOSPAM_@ mouseattack.de> wrote in message news:<bn0q97$2j a$01
      $1@news.t-online.com>...[color=blue]
      > Hi !
      >
      > I am looking for a command line tool which converts csv to xls. A c, c++
      > example source for a commandline application, which reads a file, parses
      > it, and writes it to another file would be a good help for the first
      > step. The source and destination should be given as command line
      > arguments. I hope this must be simple and was done million times before.
      >
      > If there is a complete source / tool out there and someone knows about
      > it, a link or the whole script would be fine.
      >
      > Thanks for every advice
      > Mirko[/color]

      Comment

      • Mirko

        #4
        Re: coding a csv to xls tool

        Help_xyz wrote:
        [color=blue]
        > but if the target is .xls (excel sheet) then why dont you use the
        > features
        > in microsoft excel itself which will allow you to get a csv file and
        > convert to the xls..[/color]

        Thanks for your answers but i think i have to explain a litte more:
        I need this tool because MS-Excel is _not_ available on the target
        machine. So its not possible to load the csv data into Excel.
        Unfortunaly Excel-Format is needed for the importfilter of a special db
        system. I may not change anything around. I have to take it as it is. I
        would care about the conversion myself, i only hoped to find the simple
        c++ structure around it, where i could implement the parsing function
        (MS-Excel Format is documented in the MSDN, so it must be possible). I
        don't want to use MFC or something - only native c, c++, because it has
        to run potentially on different os's and should be compileable with
        different compilers.

        Greetings,
        Mirko

        Comment

        • Thomas Matthews

          #5
          Re: coding a csv to xls tool

          Mirko wrote:
          [color=blue]
          > Help_xyz wrote:
          >[color=green]
          >> but if the target is .xls (excel sheet) then why dont you use the
          >> features
          >> in microsoft excel itself which will allow you to get a csv file and
          >> convert to the xls..[/color]
          >
          >
          > Thanks for your answers but i think i have to explain a litte more:
          > I need this tool because MS-Excel is _not_ available on the target
          > machine. So its not possible to load the csv data into Excel.
          > Unfortunaly Excel-Format is needed for the importfilter of a special db
          > system. I may not change anything around. I have to take it as it is. I
          > would care about the conversion myself, i only hoped to find the simple
          > c++ structure around it, where i could implement the parsing function
          > (MS-Excel Format is documented in the MSDN, so it must be possible). I
          > don't want to use MFC or something - only native c, c++, because it has
          > to run potentially on different os's and should be compileable with
          > different compilers.
          >
          > Greetings,
          > Mirko
          >[/color]




          --
          Thomas Matthews

          C++ newsgroup welcome message:

          C++ Faq: http://www.parashift.com/c++-faq-lite
          C Faq: http://www.eskimo.com/~scs/c-faq/top.html
          alt.comp.lang.l earn.c-c++ faq:

          Other sites:
          http://www.josuttis.com -- C++ STL Library book

          Comment

          • Klaus Eichner

            #6
            Re: coding a csv to xls tool

            "Mirko" <mirko_NOSPAM_@ mouseattack.de> wrote in message
            news:bn0q97$2ja $01$1@news.t-online.com...

            [Snip]
            [color=blue]
            > A c, c++ example source for a commandline application, which
            > reads a file, parses it, and writes it to another file would be a
            > good help for the first step. The source and destination should
            > be given as command line arguments.[/color]

            I recommend to read Chapter 21.5.1 (File Streams) of the book "The C++
            Programming Language", 3rd edition, by Bjarne Stroustrup. It shows a
            complete program that copies one file to another. The file names are taken
            as commandline arguments.

            [Snip]
            [color=blue]
            > Thanks for every advice
            > Mirko[/color]



            Comment

            Working...