Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to convert .xls file to multiple csv files using C language where i have data in a format empid,name,age,sal,depart,grade and need to create 3 files using the code . They are like file 1 : empid,name, age file 2: empid, sal file 3: empid,depart file 4: grade, salary structure and this should be done in one shot batch mode
Posted

1 solution

1) When you have Excel installed you can use the Office-Api in Visual-Studio and iterate through the lines. This means that all code is only working on systems that have a certain version of Excel. Using the native .xls-file-format with an own C-program is beyond the scope of this task. ->(best start, when you have used Active-X and COM/OLE, most native solution)

2) You save your file in the new XLSX (xml-based) and create a program that is based on an xml-parser going through all entries. ->(most cool "standard" solution that takes most time)

3) You save your file in .csv already (Excel can do that); then go through the lines with a program. ->(Most practicable solution for a pure "C"-person)

4) You buy a third-party tool like "Altova Mapforce Enterprise Edition" and click your program together, then let the tool generate your xls2csv tool. ->(Fastest solution, most expensive when you do not already own such a tool)
 
Share this answer
 
Comments
ShankarSughosh 5-Feb-13 3:30am    
Thanks a lot
please do tell me the procedure to do so.
And can you help me with the C source code on this.

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