Beispiel #1
0
        /// <summary>
        ///   Uses the <see cref="GenericParser"/> to read the Csv file.
        /// </summary>
        private static void _GenericParser10Csv()
        {
            string s;

            using (Old.GenericParser gp = new Old.GenericParser(PerformanceTests.CSV_DATA_FILE))
            {
                gp.MaxBufferSize = 4096;

                while (gp.Read())
                {
                    for (int i = 0; i < gp.ColumnCount; ++i)
                    {
                        s = gp[i];
                    }
                }
            }
        }
Beispiel #2
0
        /// <summary>
        ///   Uses the <see cref="GenericParser"/> to read the FixedWidth file.
        /// </summary>
        private static void _GenericParser10FixedWidth()
        {
            string s;

            using (Old.GenericParser gp = new Old.GenericParser(PerformanceTests.FW_DATA_FILE))
            {
                gp.MaxBufferSize = 4096;
                gp.ColumnWidths  = new int[PerformanceTests.NUMBER_OF_COLUMNS_IN_DATA] {
                    5, 5, 1, 28, 42, 15, 13, 9, 9, 1, 13, 14, 13, 6
                };
                gp.TrimResults = true;

                while (gp.Read())
                {
                    for (int i = 0; i < gp.ColumnCount; ++i)
                    {
                        s = gp[i];
                    }
                }
            }
        }
        /// <summary>
        ///   Uses the <see cref="GenericParser"/> to read the FixedWidth file.
        /// </summary>
        private static void _GenericParser10FixedWidth()
        {
            string s;

            using (Old.GenericParser gp = new Old.GenericParser(PerformanceTests.FW_DATA_FILE))
            {
                gp.MaxBufferSize = 4096;
                gp.ColumnWidths = new int[PerformanceTests.NUMBER_OF_COLUMNS_IN_DATA] { 5, 5, 1, 28, 42, 15, 13, 9, 9, 1, 13, 14, 13, 6 };
                gp.TrimResults = true;

                while (gp.Read())
                {
                    for (int i = 0; i < gp.ColumnCount; ++i)
                        s = gp[i];
                }
            }
        }
        /// <summary>
        ///   Uses the <see cref="GenericParser"/> to read the Csv file.
        /// </summary>
        private static void _GenericParser10Csv()
        {
            string s;

            using (Old.GenericParser gp = new Old.GenericParser(PerformanceTests.CSV_DATA_FILE))
            {
                gp.MaxBufferSize = 4096;

                while (gp.Read())
                {
                    for (int i = 0; i < gp.ColumnCount; ++i)
                        s = gp[i];
                }
            }
        }