coding a csv to xls tool

M

Mirko

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
 
T

Thomas Matthews

Mirko said:
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

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,
discusses issues about the language, not
applications of it.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 
H

Help_xyz

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..
 
M

Mirko

Help_xyz said:
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..

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
 
T

Thomas Matthews

Mirko said:
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

http://www.wotsit.org


--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 
K

Klaus Eichner

[Snip]
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 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]
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top