Beispiel #1
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "CsvDataReader" /> class.
        /// </summary>
        /// <param name = "csvFileName">Name of the CSV file.</param>
        /// <param name = "encoding">The encoding.</param>
        /// <param name = "separatorChar">The separator char.</param>
        public CsvDataReader(string csvFileName, Encoding encoding, char separatorChar)
        {
            encoding.AssertNotNull("encoding");

            if (!File.Exists(csvFileName))
            {
                throw new FileNotFoundException("Cannot find the CSV file: " + csvFileName);
            }

            this.reader = new StreamReader(csvFileName, encoding);

            this.separatorChar = separatorChar;
        }