示例#1
0
 public static IEnumerable <EventData> ImportData(string file)
 {
     using (var sr = new StreamReader(file))
     {
         var line = string.Empty;
         while (!sr.EndOfStream)
         {
             line = sr.ReadLine();
             var d = EventData.FromCsv(line);
             if (d == null)
             {
                 Debug.WriteLine($"Could not parse CSV: {line}");
             }
             else
             {
                 yield return(d);
             }
         }
     }
 }