Пример #1
0
 private static void LoadValues(CSVFile file, StreamReader streamReader)
 {
     while (!streamReader.EndOfStream)
     {
         List <string> currentValues = ReadLine(streamReader);
         file.AddValue(new CSVRow(currentValues));
     }
 }
Пример #2
0
        public static CSVFile Read(string path)
        {
            CSVFile csvFile = new CSVFile();

            using (FileStream fileStream = File.OpenRead(path))
            {
                using (StreamReader streamReader = new StreamReader(fileStream))
                {
                    LoadHeader(csvFile, streamReader);
                    LoadValues(csvFile, streamReader);
                }
            }
            return(csvFile);
        }
Пример #3
0
        private static void LoadHeader(CSVFile file, StreamReader streamReader)
        {
            List <string> headerValues = ReadLine(streamReader);

            file.SetHeader(new CSVRow(headerValues));
        }