Click here to Skip to main content
Click here to Skip to main content
Articles » Database » Database » Utilities » Downloads
 
Add your own
alternative version

A Fast CSV Reader

, 10 Nov 2011
A reader that provides fast, non-cached, forward-only access to CSV data.
csvreader11_demo.zip
CsvReader11_demo
CsvReader11_demo
CsvReader11_demo
CsvReaderBenchmarks
App.ico
data.rar
CsvReaderDemo
App.ico
LumenWorks.Framework.IO
Csv
Events
Exceptions
Resources
LumenWorks.Framework.Tests.Unit
IO
Csv
CsvReaderBenchmarks
App.ico
data.rar
CsvReaderDemo
App.ico
LumenWorks.Framework.IO
Csv
Events
Exceptions
Resources
LumenWorks.Framework.Tests.Unit
IO
Csv
CsvReaderBenchmarks
App.ico
data.rar
CsvReaderDemo
App.ico
LumenWorks.Framework.IO
Csv
Events
Exceptions
Resources
LumenWorks.Framework.Tests.Unit
IO
Csv
csvreader11_src.zip
CsvReader11_src
CsvReader11_src
CsvReader11_src
LumenWorks.Framework.IO
Csv
Events
Exceptions
Resources
LumenWorks.Framework.Tests.Unit
IO
Csv
LumenWorks.Framework.IO
Csv
Events
Exceptions
Resources
LumenWorks.Framework.Tests.Unit
IO
Csv
LumenWorks.Framework.IO
Csv
Events
Exceptions
Resources
LumenWorks.Framework.Tests.Unit
IO
Csv
csvreader20_demo.zip
CsvReader20_demo
CsvReader20_demo
CsvReader20_demo
CsvReaderBenchmarks
bin
Release
CsvReaderBenchmarks.exe
CsvReaderBenchmarks.vshost.exe
LumenWorks.Framework.IO.dll
data.rar
Properties
CsvReaderDemo
bin
Release
CsvReaderDemo.exe
LumenWorks.Framework.IO.dll
LumenWorks.Framework.Tests.Unit.dll
Properties
Settings.settings
LumenWorks.Framework.IO
bin
Release
LumenWorks.Framework.IO.dll
Csv
Events
Exceptions
Resources
Properties
LumenWorks.Framework.Tests.Unit
bin
Release
LumenWorks.Framework.IO.dll
LumenWorks.Framework.Tests.Unit.dll
IO
Csv
Properties
CsvReaderBenchmarks
bin
Release
CsvReaderBenchmarks.exe
LumenWorks.Framework.IO.dll
data.rar
Properties
CsvReaderDemo
bin
Release
CsvReaderDemo.exe
LumenWorks.Framework.IO.dll
LumenWorks.Framework.Tests.Unit.dll
Properties
Settings.settings
LumenWorks.Framework.IO
bin
Release
LumenWorks.Framework.IO.dll
Csv
Events
Exceptions
Resources
Properties
LumenWorks.Framework.Tests.Unit
bin
Release
LumenWorks.Framework.IO.dll
LumenWorks.Framework.Tests.Unit.dll
IO
Csv
Properties
CsvReaderBenchmarks
bin
Release
CsvReaderBenchmarks.exe
LumenWorks.Framework.IO.dll
data.rar
Properties
CsvReaderDemo
bin
Release
CsvReaderDemo.exe
LumenWorks.Framework.IO.dll
LumenWorks.Framework.Tests.Unit.dll
Properties
Settings.settings
LumenWorks.Framework.IO
bin
Release
LumenWorks.Framework.IO.dll
Csv
Events
Exceptions
Resources
Properties
LumenWorks.Framework.Tests.Unit
bin
Release
LumenWorks.Framework.IO.dll
LumenWorks.Framework.Tests.Unit.dll
IO
Csv
Properties
csvreader20_src.zip
CsvReader20_src
CsvReader20_src
CsvReader20_src
LumenWorks.Framework.IO
bin
Release
LumenWorks.Framework.IO.dll
Csv
Events
Exceptions
Resources
Properties
LumenWorks.Framework.Tests.Unit
bin
Release
LumenWorks.Framework.IO.dll
LumenWorks.Framework.Tests.Unit.dll
IO
Csv
Properties
LumenWorks.Framework.IO
bin
Release
LumenWorks.Framework.IO.dll
Csv
Events
Exceptions
Resources
Properties
LumenWorks.Framework.Tests.Unit
bin
Release
LumenWorks.Framework.IO.dll
LumenWorks.Framework.Tests.Unit.dll
IO
Csv
Properties
LumenWorks.Framework.IO
bin
Release
LumenWorks.Framework.IO.dll
Csv
Events
Exceptions
Resources
Properties
LumenWorks.Framework.Tests.Unit
bin
Release
LumenWorks.Framework.IO.dll
LumenWorks.Framework.Tests.Unit.dll
IO
Csv
Properties
CsvReader_bin.zip
csvreader_demo.zip
CsvReaderDemo
CsvReaderDemo
bin
Release
CsvReaderDemo.exe
CsvReaderDemo.vshost.exe
LumenWorks.Framework.IO.dll
data.rar
Properties
CsvReaderTests
bin
Release
CsvReaderTests.dll
LumenWorks.Framework.IO.dll
Properties
LumenWorks.Framework.IO
bin
Release
LumenWorks.Framework.IO.dll
Csv
Exceptions
Resources
Properties
CsvReader_Profiler.zip
CsvReader_src.zip
bin
Release
CsvReaderDemo.exe
CsvReaderDemo.vshost.exe
CsvReaderDemo.vshost.exe.manifest
LumenWorks.Framework.IO.dll
LumenWorks.Framework.Tests.Unit.dll
Properties
Settings.settings
CsvReaderDemoWeb
bin
CsvReaderDemoWeb.dll
LumenWorks.Framework.IO.dll
LumenWorks.Framework.Tests.Unit.dll
Properties
LumenWorks.Framework.IO
bin
Release
LumenWorks.Framework.IO.dll
Csv
Events
Exceptions
Resources
LumenWorks.Framework.snk
Properties
LumenWorks.Framework.Tests.Unit
bin
Release
LumenWorks.Framework.IO.dll
LumenWorks.Framework.Tests.Unit.dll
IO
Csv
Properties
CsvReaderBenchmarks
bin
Release
CsvReaderBenchmarks.exe
CsvReaderBenchmarks.vshost.exe
CsvReaderBenchmarks.vshost.exe.manifest
LumenWorks.Framework.IO.dll
data.rar
Properties
<?xml version="1.0" encoding="utf-8" ?>
<root>
	<!-- 
    Microsoft ResX Schema 
    
    Version 2.0
    
    The primary goals of this format is to allow a simple XML format 
    that is mostly human readable. The generation and parsing of the 
    various data types are done through the TypeConverter classes 
    associated with the data types.
    
    Example:
    
    ... ado.net/XML headers & schema ...
    <resheader name="resmimetype">text/microsoft-resx</resheader>
    <resheader name="version">2.0</resheader>
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
        <value>[base64 mime encoded serialized .NET Framework object]</value>
    </data>
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
        <comment>This is a comment</comment>
    </data>
                
    There are any number of "resheader" rows that contain simple 
    name/value pairs.
    
    Each data row contains a name, and value. The row also contains a 
    type or mimetype. Type corresponds to a .NET class that support 
    text/value conversion through the TypeConverter architecture. 
    Classes that don't support this are serialized and stored with the 
    mimetype set.
    
    The mimetype is used for serialized objects, and tells the 
    ResXResourceReader how to depersist the object. This is currently not 
    extensible. For a given mimetype the value must be set accordingly:
    
    Note - application/x-microsoft.net.object.binary.base64 is the format 
    that the ResXResourceWriter will generate, however the reader can 
    read any of the formats listed below.
    
    mimetype: application/x-microsoft.net.object.binary.base64
    value   : The object must be serialized with 
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
            : and then encoded with base64 encoding.
    
    mimetype: application/x-microsoft.net.object.soap.base64
    value   : The object must be serialized with 
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array 
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
	<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
		<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
		<xsd:element name="root" msdata:IsDataSet="true">
			<xsd:complexType>
				<xsd:choice maxOccurs="unbounded">
					<xsd:element name="metadata">
						<xsd:complexType>
							<xsd:sequence>
								<xsd:element name="value" type="xsd:string" minOccurs="0" />
							</xsd:sequence>
							<xsd:attribute name="name" use="required" type="xsd:string" />
							<xsd:attribute name="type" type="xsd:string" />
							<xsd:attribute name="mimetype" type="xsd:string" />
							<xsd:attribute ref="xml:space" />
						</xsd:complexType>
					</xsd:element>
					<xsd:element name="assembly">
						<xsd:complexType>
							<xsd:attribute name="alias" type="xsd:string" />
							<xsd:attribute name="name" type="xsd:string" />
						</xsd:complexType>
					</xsd:element>
					<xsd:element name="data">
						<xsd:complexType>
							<xsd:sequence>
								<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
								<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
							</xsd:sequence>
							<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
							<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
							<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
							<xsd:attribute ref="xml:space" />
						</xsd:complexType>
					</xsd:element>
					<xsd:element name="resheader">
						<xsd:complexType>
							<xsd:sequence>
								<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
							</xsd:sequence>
							<xsd:attribute name="name" type="xsd:string" use="required" />
						</xsd:complexType>
					</xsd:element>
				</xsd:choice>
			</xsd:complexType>
		</xsd:element>
	</xsd:schema>
	<resheader name="resmimetype">
		<value>text/microsoft-resx</value>
	</resheader>
	<resheader name="version">
		<value>2.0</value>
	</resheader>
	<resheader name="reader">
		<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
	</resheader>
	<resheader name="writer">
		<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
	</resheader>
	<data name="BufferSizeTooSmall" xml:space="preserve">
		<value>Buffer size must be 1 or more.</value>
	</data>
	<data name="CannotMovePreviousRecordInForwardOnly" xml:space="preserve">
		<value>Cannot move to a previous record in forward-only mode.</value>
	</data>
	<data name="CannotReadRecordAtIndex" xml:space="preserve">
		<value>Cannot read record at index '{0}'.</value>
		<comment>index:int</comment>
	</data>
	<data name="EnumerationFinishedOrNotStarted" xml:space="preserve">
		<value>Enumeration has either not started or has already finished.</value>
	</data>
	<data name="EnumerationVersionCheckFailed" xml:space="preserve">
		<value>Collection was modified; enumeration operation may not execute.</value>
	</data>
	<data name="FieldHeaderNotFound" xml:space="preserve">
		<value>'{0}' field header not found.</value>
		<comment>header:string</comment>
	</data>
	<data name="FieldIndexOutOfRange" xml:space="preserve">
		<value>Field index must be included in [0, FieldCount[. Specified field index was : '{0}'.</value>
		<comment>index:int</comment>
	</data>
	<data name="MalformedCsvException" xml:space="preserve">
		<value>The CSV appears to be corrupt near record '{0}' field '{1} at position '{2}'. Current raw data : '{3}'.</value>
		<comment>currentRecordIndex:int;currentFieldIndex:int;currentPosition:int;rawData:string</comment>
	</data>
	<data name="MissingFieldActionNotSupported" xml:space="preserve">
		<value>'{0}' is not a supported missing field action.</value>
		<comment>missingFieldAction:LumenWorks.Framework.IO.Csv.MissingFieldAction</comment>
	</data>
	<data name="NoCurrentRecord" xml:space="preserve">
		<value>No current record.</value>
	</data>
	<data name="NoHeaders" xml:space="preserve">
		<value>The CSV does not have headers (CsvReader.HasHeaders property is false).</value>
	</data>
	<data name="NotEnoughSpaceInArray" xml:space="preserve">
		<value>The number of fields in the record is greater than the available space from index to the end of the destination array.</value>
	</data>
	<data name="ParseErrorActionInvalidInsideParseErrorEvent" xml:space="preserve">
		<value>'{0}' is not a valid ParseErrorAction while inside a ParseError event.</value>
		<comment>parseErrorAction:LumenWorks.Framework.IO.Csv.ParseErrorAction</comment>
	</data>
	<data name="ParseErrorActionNotSupported" xml:space="preserve">
		<value>'{0}' is not a supported ParseErrorAction.</value>
		<comment>parseErrorAction:LumenWorks.Framework.IO.Csv.ParseErrorAction</comment>
	</data>
	<data name="ReaderClosed" xml:space="preserve">
		<value>This operation is invalid when the reader is closed.</value>
	</data>
	<data name="RecordIndexLessThanZero" xml:space="preserve">
		<value>Record index must be 0 or more.</value>
	</data>
</root>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License

About the Author

Sebastien Lorion
Architect
Canada Canada
Sébastien Lorion is software architect as day job.
 
He is also a musician, actually singing outside the shower Smile | :)
 
He needs constant mental and emotional stimulation, so all of this might change someday ...

| Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 10 Nov 2011
Article Copyright 2005 by Sebastien Lorion
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid