anrodse.csvparser 1.0.7038.39789

There is a newer version of this package available.
See the version list below for details.
dotnet add package anrodse.csvparser --version 1.0.7038.39789
NuGet\Install-Package anrodse.csvparser -Version 1.0.7038.39789
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="anrodse.csvparser" Version="1.0.7038.39789" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add anrodse.csvparser --version 1.0.7038.39789
#r "nuget: anrodse.csvparser, 1.0.7038.39789"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install anrodse.csvparser as a Cake Addin
#addin nuget:?package=anrodse.csvparser&version=1.0.7038.39789

// Install anrodse.csvparser as a Cake Tool
#tool nuget:?package=anrodse.csvparser&version=1.0.7038.39789

CsvParser

A simple csv file parser, using class attributes.

Using the CsvParser library

Write your model using CsvCol attribute for choosen properties:

public class Foo
{
	[CsvCol("Bar")]
	public string MyBar { get; set; }
}

Read the file using the parser

public List<Foo> void Read()
{
	string file = "PATH\TO\FILE.csv";
	Serialization.CsvSerializer csv = new Serialization.CsvSerializer(typeof(Foo));
	return csv.Deserialize(new CsvReader(file));
}

Reading file by lines

Files can be read line by line into a list of strings

public void ReadByLine()
{
	string file = "PATH\TO\FILE.csv";
	CsvReader reader = new CsvReader(file);
	List<string> row = new List<string>();

	reader.ReadHeader(row);
	Console.WriteLine(String.Join(";", row));	// Print file headers
	while (reader.ReadRow(row))
	{
		Console.WriteLine(String.Join(";", row));	// Print file as it is
	}
}

Contact

Let me know if you find any bug or if you have code improvements.

Product Compatible and additional computed target framework versions.
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.7217.33447 584 10/5/2019
1.0.7038.39789 539 4/9/2019

Package release.