Package

io.chrisdavenport.cormorant

parser

Permalink

package parser

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. parser
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. object CSVParser

    Permalink

    This CSVParser tries to stay fairly close to the initial specification https://tools.ietf.org/html/rfc4180

    This CSVParser tries to stay fairly close to the initial specification https://tools.ietf.org/html/rfc4180

    Deviations from the specification, here I have chosen to use a permissive CRLF that will accept a CRLF or a LF.

    The important details are as follows 1. Each record is located on a separate line, delimited by a line break (CRLF). For example:

    aaa,bbb,ccc CRLF zzz,yyy,xxx CRLF

    2. The last record in the file may or may not have an ending line break. For example:

    aaa,bbb,ccc CRLF zzz,yyy,xxx

    3. There maybe an optional header line appearing as the first line of the file with the same format as normal record lines. This header will contain names corresponding to the fields in the file and should contain the same number of fields as the records in the rest of the file (the presence or absence of the header line should be indicated via the optional "header" parameter of this MIME type). For example:

    field_name,field_name,field_name CRLF aaa,bbb,ccc CRLF zzz,yyy,xxx CRLF 4. Within the header and each record, there may be one or more fields, separated by commas. Each line should contain the same number of fields throughout the file. Spaces are considered part of a field and should not be ignored. The last field in the record must not be followed by a comma. For example:

    aaa,bbb,ccc

    5. Each field may or may not be enclosed in double quotes (however some programs, such as Microsoft Excel, do not use double quotes at all). If fields are not enclosed with double quotes, then double quotes may not appear inside the fields. For example:

    "aaa","bbb","ccc" CRLF zzz,yyy,xxx

    6. Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes. For example:

    "aaa","b CRLF bb","ccc" CRLF zzz,yyy,xxx

    7. If double-quotes are used to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote. For example:

    "aaa","b""bb","ccc"

  2. object TSVParser

    Permalink
  3. def parseComplete(text: String, cleanup: Boolean = true): Either[ParseFailure, Complete]

    Permalink
  4. def parseField(text: String): Either[ParseFailure, Field]

    Permalink
  5. def parseHeader(text: String): Either[ParseFailure, Header]

    Permalink
  6. def parseHeaders(text: String): Either[ParseFailure, Headers]

    Permalink
  7. def parseRow(text: String): Either[ParseFailure, Row]

    Permalink
  8. def parseRows(text: String, cleanup: Boolean = true): Either[ParseFailure, Rows]

    Permalink
  9. def parseTSVComplete(text: String, cleanup: Boolean = true): Either[ParseFailure, Complete]

    Permalink
  10. def parseTSVField(text: String): Either[ParseFailure, Field]

    Permalink
  11. def parseTSVHeader(text: String): Either[ParseFailure, Header]

    Permalink
  12. def parseTSVHeaders(text: String): Either[ParseFailure, Headers]

    Permalink
  13. def parseTSVRow(text: String): Either[ParseFailure, Row]

    Permalink
  14. def parseTSVRows(text: String, cleanup: Boolean = true): Either[ParseFailure, Rows]

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped