private List <RowData> ParseRawDataInToRows(StreamReader rawdata)
        {
            var    rows = new List <RowData>();
            string line;

            rawdata.ReadLine();
            while ((line = rawdata.ReadLine()) != null)
            {
                var     fields = line.Split(new Char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                RowData data   = new RowData(fields[0], int.Parse(fields[1]), int.Parse(fields[2]), double.Parse(fields[3]));
                rows.Add(data);
            }
            return(rows);
        }
示例#2
0
        public IEnumerable <RowData> Rows(IEnumerable <IRowData> GetRows)
        {
            List <RowData> rows = new List <RowData>();

            using (var readerdata = new StreamReader("C:\\users\\callum\\Documents\\WTW\\interleaved_products.csv"))
            {
                string line;
                readerdata.ReadLine();
                while ((line = readerdata.ReadLine()) != null)
                {
                    var     fields = line.Split(new Char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                    RowData data   = new RowData(fields[0], int.Parse(fields[1]), int.Parse(fields[2]), double.Parse(fields[3]));
                    rows.Add(data);
                }
                return(rows);
            }
        }