在 C# 中创建表并写入表
我有一个返回结果的函数,这是结果:
3.98901669117011 vm
0.138912911874081 nvm
2.30800830234368 hg
1.13724811900026 ms
2.33557467785177 ls
90.0912392977601 none
我希望单词位于表格的顶部,数字位于行中,侧面是一些字符串,这是一个示例:
如何在 C# 中创建一个表并写入我编写的内容?
I have a function that return a results, here is the results:
3.98901669117011 vm
0.138912911874081 nvm
2.30800830234368 hg
1.13724811900026 ms
2.33557467785177 ls
90.0912392977601 none
I want the words to be in the top of the table, and the numbers in the rows, and in the sides some string, here is an example:
How can I create a table in C# and write to it what I wrote?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您需要在 Excel 中打开导出的文件,只需保存 CSV 文件。第一行将包含列名称,其余行将是数据行。
以下代码将编写一个可以在 Excel 中打开的 CSV 文件。它看起来就像你的图片一样。
If you need to open the exported file in Excel, you could simply save a CSV file. The first line would have the column names the rest of the lines would be the data rows.
The following code will write a CSV file that can be opened in Excel. It will look just like your image.