Exemplo n.º 1
0
        /// <summary>
        /// Read CSV data from a text stream
        /// </summary>
        /// <param name="stream">Base stream to read from</param>
        /// <param name="delimiter">Delimiter to be used</param>
        /// <returns>Enumeration of rows, Each row is a string[] of columns</returns>
        public static IEnumerable <string[]> ReadDelimiter(StreamReader stream, char delimiter = ';')
        {
            FastCsv fast = new FastCsv();

            fast.Delimiter = delimiter;
            return(fast.ReadDelimiter(stream));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Read CSV data from a data stream
        /// </summary>
        /// <param name="stream">Base stream to read from</param>
        /// <param name="encoding">Encoding to be used</param>
        /// <param name="delimiter">Delimiter to be used</param>
        /// <returns>Enumeration of rows, Each row is a string[] of columns</returns>
        public static IEnumerable <string[]> ReadDelimiter(Stream stream, Encoding encoding = null, char delimiter = ';')
        {
            FastCsv fast = new FastCsv();

            if (encoding != null)
            {
                fast.Encoding = encoding;
            }
            fast.Delimiter = delimiter;
            return(fast.ReadDelimiter(stream));
        }