Very simple C# CSV reader

后端 未结 7 1476
渐次进展
渐次进展 2020-11-27 15:08

I\'d like to create an array from a CSV file.

This is about as simple as you can imagine, the CSV file will only ever have one line and these values:



        
7条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-27 15:52

    If there is only ever one line then do something like this:

    using System;
    using System.IO;
    
    class Program
    {
        static void Main()
        {
            String[] values = File.ReadAllText(@"d:\test.csv").Split(',');
        }
    }
    

提交回复
热议问题