且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用c代码将Excel转换为csv

更新时间:2023-02-16 21:09:35

1)安装Excel后,可以在Visual Studio中使用Office-Api并遍历这些行。这意味着所有代码仅适用于具有特定版本Excel的系统。将本机.xls文件格式与自己的C程序一起使用超出了此任务的范围。 - >(***开始,当您使用Active-X和COM / OLE时,大多数原生解决方案)



2)您将文件保存在新的XLSX中(基于xml)并创建一个基于遍历所有条目的xml-parser的程序。 - >(最酷的标准解决方案需要花费大部分时间)



3)您已将文件保存在.csv中(Excel可以这样做);然后通过程序进行操作。 - >(对于纯粹的C人来说最实用的解决方案)



4)您购买第三方工具,如Altova Mapforce Enterprise Edition并点击你的程序在一起,然后让工具生成你的xls2csv工具。 - >(最快的解决方案,当你还没有这样的工具时最贵)
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)