Skip to main content

CSV Reader/Writer Classes (Original)

Note: This page relates to the Csv Reader/Writer classes in Kajabity Tools Original library, for the revised Kajabity.Tools.Csv library go to CSV Reader/Writer Classes.

The CSV Reader/Writer classes are shown in the UML Class Diagram below (with private members hidden for clarity):

UML class diagram of Kajabity Tools CSV classes.

The classes are: –

  • CsvReader – a C# class that can read a whole CSV format file or read individual fields or lines one at a time. If you read individual fields or lines, the next read (field, line or rest of file) starts from where the last read left off.
  • CsvWriter – this class is the reverse of the CsvReader class, providing methods to write individual fields, rows or a whole array of string arrays to a Stream (or file).
  • CsvParseException – this exception is thrown if the contents of the Stream being read by CsvReader are invalid.
  • CsvConstants – a supporting class defining common defaults for both reader and writer classes.