且构网

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

将.csv文件转换为.xls文件?

更新时间:2023-11-25 15:33:10

正如 Richard 所建议的那样,获得此类转换的直接方法是使用 Excel 本身。 Excel 可以导入CSV文件,并以自己的格式保存工作表。

一种替代方案可能是 Excel Automation ,虽然C编程语言不是最适合的。


你列出了MatLab,假设你知道如何使用它并在你的机器上安装MatLab,写Microsoft Excel电子表格文件 - MATLAB xlswrite [ ^ ]



问候。


我使用libxlsxwriter静态库来创建直接将CSV转换为XSLX文件的C程序 - 具有完整格式,多个选项卡等。



请参阅: libxlsxwriter [ ^ ]



将CSV转换为XLS(x)的最简单方法是将CSV直接加载到Excel并另存为XLSx文件类型。



希望这会有所帮助。



:)


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

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.


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.


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.

:)