【发布时间】:2020-06-08 06:50:47
【问题描述】:
我的应用程序正在生成一个 CSV 文件,该文件可以在 Microsoft excel 和 Notepad++ 中正确打开。但无法在 Vim(Linux 文本编辑器)中打开。我尝试了多种方法来生成这个 csv,但它没有正确显示 vim 中的数据。
如果我在 excel 中打开该 CSV 并再次将其保存为 csv 扩展名,那么它只能在 vim 应用程序中使用。
我目前的代码如下——
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("content-disposition", "attachment; filename=mytest.csv");
Response.BufferOutput = true;
Response.OutputStream.Write(doc.File_Stream, 0, doc.File_Stream.Length);
Response.End();
我也试过下面的代码
Response.ContentType = "text/csv";
Response.AddHeader("content-disposition", "attachment; filename=myTest.csv");
Response.BufferOutput = true;
Response.OutputStream.Write(doc.File_Stream, 0, doc.File_Stream.Length);
Response.End();
仍然无法使用 VIM。它显示文件的输出如下
【问题讨论】:
-
vi 中什么“失败”了?有错误信息吗?
-
@DavidFox 不是错误消息,但是当我在 vim 中打开它时,它没有以正确的格式显示任何数据。我已经添加了有问题的屏幕截图
-
@omkarpatade,看看this other post。我相信它会解决你的问题。
标签: c# linux csv model-view-controller vim