Esempio n. 1
0
        public CsvFileReader(CsvSource csvSource, CsvDefinition csvDefinition)
        {
            var streamReader = csvSource.TextReader as StreamReader;

            if (streamReader != null)
            {
                this.BaseStream = streamReader.BaseStream;
            }
            if (csvDefinition == null)
            {
                csvDefinition = DefaultCsvDefinition;
            }
            this.fieldSeparator = csvDefinition.FieldSeparator;
            this.textQualifier  = csvDefinition.TextQualifier;

            this.textReader = csvSource.TextReader;// new FileStream(csvSource.TextReader, FileMode.Open);

            this.ReadHeader(csvDefinition.Header);
        }
Esempio n. 2
0
        public static IEnumerable <T> Read <T>(CsvSource csvSource) where T : new()
        {
            var csvFileReader = new CsvFileReader <T>(csvSource);

            return((IEnumerable <T>)csvFileReader);
        }
Esempio n. 3
0
 public CsvFileReader(CsvSource csvSource)
     : this(csvSource, null)
 {
 }