Click here to Skip to main content
15,887,303 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am looking for a c or matlab program which can convert .csv file to .xls file?

What I have tried:

i did with c program by replacing every comma by a tab but it didn't work properly
Posted
Updated 9-Sep-16 14:17pm
Comments
Member 12727231 8-Sep-16 6:02am    
I am looking for a c or matlab program which can convert .csv file to .xls file?

What I have tried:

i did with c program by replacing every comma by a tab but it didn't work properly
Permalink Posted 37 secs ago
Member 12727233352
Have a Question or Comment?
Add your solution here
Patrice T 8-Sep-16 6:23am    
"it didn't work properly" is bot informative.
[no name] 9-Sep-16 19:48pm    
If you think that someone here is going to write this program for you, you have come to the wrong place. We are also not a program/code finding service.

As Richard suggested, the straightforward way to obtain such conversion is using Excel itself. Excel can import CSV files and thes save the worksheet in its own format.
One alternative could be Excel Automation, though C programming language is not the best suited for.
 
Share this answer
 
Comments
Member 12727233 9-Sep-16 2:46am    
Friend i have to do it for like 3000 files so i can't do it manually , that's why i am lookinf for a program so i can do for all the files by a single program.
so if you can help me out with c program or matlab ..it would be more needful,thanks in advance.
CPallini 9-Sep-16 2:50am    
Probably you best bet would be C#. See, for instance:
http://csharp.net-informations.com/excel/csharp-excel-tutorial.htm
You listed MatLab, assuming you do know how to use it and have MatLab on your machine, Write Microsoft Excel spreadsheet file - MATLAB xlswrite[^]

Regards.
 
Share this answer
 
Comments
Member 12727233 9-Sep-16 2:48am    
yess i done it with matlab program but xls file which i have generated using matlab is not in readable format so i am looking for a better solution ...which i can expect you talented people will provide me ..
thanks in advance
S Houghtelin 9-Sep-16 7:19am    
What do you mean by not in readable format? Are you attempting to open an .xls file without using Excel or are you trying to generate tab delimited files? You are not describing your file very well.
I use the libxlsxwriter static library to create C programs that convert CSV to XSLX files directly - with full formatting, multiple tabs, etc.

See: libxlsxwriter[^]

The easiest way to convert CSV to XLS(x) is to load the CSV directly in to Excel and Save As an XLSx file type.

Hope this helps.

:)
 
Share this answer
 
Quote:
i did with c program by replacing every comma by a tab but it didn't work properly

This is not a conversion from csv to xls !
This is just another flavor of csv and excel know how to open both csv flavors as already stated in previous answers.
the only interest of using tabs is that it is easier to handle strings that include commas. Note that comma is also used as decimal point in many countries in Europe.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900