https://github.com/abbgrade/csv-dotnet
A simple .NET library for CSV file access.
https://github.com/abbgrade/csv-dotnet
Last synced: 3 months ago
JSON representation
A simple .NET library for CSV file access.
- Host: GitHub
- URL: https://github.com/abbgrade/csv-dotnet
- Owner: abbgrade
- License: mit
- Created: 2016-03-20T13:26:02.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-11-08T13:27:48.000Z (over 5 years ago)
- Last Synced: 2026-04-03T17:29:04.504Z (3 months ago)
- Language: C#
- Homepage:
- Size: 177 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# csv-dotnet
Windows: [](https://ci.appveyor.com/project/abbgrade/csv-dotnet/branch/master)
Linux: [](https://travis-ci.org/abbgrade/csv-dotnet)
A simple .NET library for CSV file access.
It's inspired by the Python csv module.
## Changelog
- [x] CSV Reader
- [ ] CSV Writer
## Usage
### StreamReader Extension Example
Import the CSV library to extend the StreamReader class.
use CSV;
Use the StreamReader.ReadRows enumerator to get the rows.
using (var reader = new StreamReader("logfile.csv", Encoding.Default))
{
foreach (var line in reader.ReadRows('\n', ',', 1))
{
Console.WriteLine(string.Join("\t", line));
}
}
### CsvReader Example
Import the CSV library to get access to the CsvReader class.
use CSV;
Use the CsvReader to get stateful access to the CSV file.
using (var reader = new CsvReader("logfile.csv", Encoding.Default, '\n', ',', 1))
{
Console.WriteLine(string.Join("\t", reader.Header));
foreach(var row in reader.Rows)
Console.WriteLine(string.Join("\t", row));
}