Class CSVReader

java.lang.Object
ca.phon.csv.CSVReader
All Implemented Interfaces:
Closeable, AutoCloseable

public class CSVReader extends Object implements AutoCloseable, Closeable

Reads data from a CSV file with specified settings.

We escape fields based on the rules defined in RFC4180.

Author:
Cristopher Yates
  • Constructor Details

    • CSVReader

      public CSVReader(Reader reader)
      Constructs a new CSVReader.
      Parameters:
      reader - The reader that the data is read from.
    • CSVReader

      public CSVReader(Reader reader, char[] separators)
    • CSVReader

      public CSVReader(Reader reader, CSVQuoteType quoteChar)
    • CSVReader

      public CSVReader(Reader reader, boolean trimSpaces)
    • CSVReader

      public CSVReader(Reader reader, char[] separators, CSVQuoteType quoteChar)
    • CSVReader

      public CSVReader(Reader reader, char[] separators, boolean trimSpaces)
    • CSVReader

      public CSVReader(Reader reader, CSVQuoteType quoteChar, boolean trimSpaces)
    • CSVReader

      public CSVReader(Reader reader, char[] separators, CSVQuoteType quoteChar, boolean trimSpaces)
      Constructs a new CSVReader.
      Parameters:
      reader - The reader that the data is read from.
      separators - The characters that signal the end of a field and beginning of another.
      quoteChar - The type of quote used to enclose escaped fields (single or double).
      trimSpaces - Whether to remove any leading or trailing whitespace.
  • Method Details