SimpleCsv

This project helps you to read and write CSV (Comma Separated Values) files in your program. Those files are legacy, but many developers still use them because of their readability and because every sheet-calculation program can perfectly edit them. With the classes in this project you can read/write them via a stream, so that not every byte of the CSV has to be in memory beforehand and they provide nice and fluent interfaces for all functions, they are well tested (visit the project-page) and they are capable of reading and writing quoted values. Give it a try.


Keywords
comma, separated, values, csv, reader, writer, tools, buffer, buffered, stream, convenient, quoting, fluent, chaining
License
Unlicense
Install
Install-Package SimpleCsv -Version 1.0.3.1

Documentation

NuGet NuGet license Twitter Follow

General

This section contains various useful projects that should help your development-process.

This section of our GIT repositories is free. You may copy, use or rewrite every single one of its contained projects to your hearts content.
In order to get help with basic GIT commands you may try the GIT cheat-sheet on our homepage.

This repository located on our homepage is private since this is the master- and release-branch. You may clone it, but it will be read-only.
If you want to contribute to our repository (push, open pull requests), please use the copy on github located here: the public github repository

Icon SimpleCSV

A small but powerful library for writing and reading CSV files. Supports buffered stream-input, so you don't have to have all of it in RAM.

This project helps you to read and write CSV (Comma Separated Values) files in your program. Those files are legacy, but many developers still use them because of their readability and because every sheet-calculation program can perfectly edit them. With the classes in this project you can read/write them via a stream, so that not every byte of the CSV has to be in memory beforehand and they provide nice and fluid interfaces for all functions, they are well tested (visit the project-page) and they are capable of reading and writing quoted values. Give it a try.

If you like this repo, please don't forget to star it. Thank you.

Getting Started

StringReader

StringReader stringReader = new StringReader("\"test\";test1;A 01;t;;");

CsvReader csvReader = new CsvReader(stringReader, ';', "\n", '\"');
List<string> row = csvReader.ReadRow();

StringWriter

using(CsvWriter csvWriter = new CsvWriter(new StringBuilder(), ';', "\n", '\"'))
{
  csvWriter.Write("Great");
  csvWriter.Write("Totally");
  csvWriter.Write("This is a\nbreak");
  // The next two lines do the same as calling csvWriter.writeLine("");
  csvWriter.Write();
  csvWriter.WriteLine();

  csvWriter.Write().Write("Gr;eat").WriteLine("Totally");

  csvWriter.Write("Great").Write("ssfe\"s").Write("").Write("Totally");
}

For more and more elaborate examples, take a look at the test-project.