我有一个行动 负责从数据库取出一些数据 并把它归还为CSV文件
我知道我可以用一个巨大的绳子 返回一个巨大的弦来做到这一点, 但我在想,如果有一个干净和高效的方法, 可以用一个MVC控制器的动作 来返回一个 CSV文件。
我有一个行动 负责从数据库取出一些数据 并把它归还为CSV文件
我知道我可以用一个巨大的绳子 返回一个巨大的弦来做到这一点, 但我在想,如果有一个干净和高效的方法, 可以用一个MVC控制器的动作 来返回一个 CSV文件。
您正在寻找的文件Result :
public ActionResult GetFile()
{
var stream = new StreamReader("thefilepath.txt");
return File(stream.ReadToEnd(), "text/plain");
}
最佳方面
I ve been working on this simple code that puts a CSV file into a nice table. But because the data is imported, styling ODD rows is a pretty hard thing to do. All I need would be a method to address ...
What would be the most efficient way to clean a user input that is a comma separated string made entirely on numbers - e.g 2,40,23,11,55 I use this function on a lot of my inputs function clean($...
Below is the sample csv file date,type1,type2,..... 2009-07-01,n1,n2,..... 2009-07-02,n21,n22,.... and so on... I want to add the values in each row and each column and print at the end and bottom ...
I am getting this sort of CSV data while making Http request to the CSV file. Very malformed string. response = "Subject";"Start Date";"Start Time";"End Date";"End Time";"All day event";"...
I m stumped with a problem illustrated in the sample below: "ID","NAME","PHONE","REF","DISCARD" 1,"JOHN",12345,, 2,"PETER",6232,, 3,"JON",12345,, 4,"PETERSON",6232,, 5,"ALEX",7854,, 6,"JON",12345,, ...
I’m at a very basic level with Flex and with programming in general. I am working on a project where I have data in an Excel (.csv) format, it’s a large Excel plot/matrix where each cell has a ...
I have some text file like this, with several 5000 lines: 5.6 4.5 6.8 "6.5" (new line) 5.4 8.3 1.2 "9.3" (new line) so the last term is a number between double quotes. What I want to do is, ...
Is there a PHP string function that transforms a multi-line string into a single-line string? I m getting some data back from an API that contains multiple lines. For example: <p>Some Data</...