Question: C# Task We need a valid CSV parser! A CSV (Comma-Separated Values) file is a file that represents tabular data in a simple, text-only manner.
C#
Task We need a valid CSV parser! A CSV (Comma-Separated Values) file is a file that represents tabular data in a simple, text-only manner. At its simplest, a CSV file contains rows of data separated by newlines, and each field is separated by commas. This parser needs to not only handle CSVs using commas to delimit fields, but it also needs to handle complex field values (which may be wrapped in quotes, and may span multiple lines), and also different delimiters and quote characters. Examples A simple CSV would look like this: a,b,c d,e,f which should parse to: [['a', 'b', 'c'], ['d', 'e', 'f'] While a more complex one might be: one,"two wraps onto ""two"" lines",three 4,,6 that becomes: [['one', 'two wraps onto "two" lines', 'three'], ['4', '', '6']
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
