/CsvParser

CSV parser library for .NET

Primary LanguageC#

#CSVParser.NET CSV parser library for .NET

CsvParser.Parser parser = new CsvParser.Parser();
List<List<string>> result = parser.Parse("a,b,c");
string v1 = result[0][0]; // "a"

Overview

hello world 123 456
abc,def    
CsvParser.Parser parser = new CsvParser.Parser();
List<List<string>> result = parser.Parse("\"hello world\",123,456\n" +
                                         "\"abc,def\"");
int rowCount = result.Count; //-> 2
string v1 = result[0][0]; //-> "hello world"
string v2 = result[0][1]; //-> "123"
hello
world
12,3 456
abc def  
CsvParser.Parser parser = new CsvParser.Parser();
List<List<string>> result = parser.Parse("\"hello\n" +
                                         "world\","12,3",456\n" +
                                         "abc,def");
int rowCount = result.Count; //-> 2
string v1 = result[0][0]; //-> "hello\nworld"
string v2 = result[0][1]; //-> "12,3"
hello world 123 456
REM def ghi
CsvParser.Parser parser = new CsvParser.Parser();
parser.SkipKeyWord.Add("REM");
List<List<string>> result = parser.Parse("\"hello world\","123",456\n" +                                      
                                         "REM,def,ghi");
int rowCount = result.Count; //-> 1
string v1 = result[0][0]; //-> "hello world"

nuget package

http://www.nuget.org/packages/CsvParser.NET/

Copyright (c) 2014 kenyamat. Licensed under MIT.