TableParser

com.phasmidsoftware.tableparser.core.parse.TableParser
See theTableParser companion object
trait TableParser[Table] extends TableBuilder[Table]

Type class to parse a set of rows as a Table.

Type parameters

Table

the Table type.

Attributes

Companion
object
Graph
Supertypes
trait TableBuilder[Table]
class Object
trait Matchable
class Any
Known subtypes

Members list

Type members

Types

type Input

The input type, typically String or Strings.

The input type, typically String or Strings.

Attributes

Inherited and Abstract types

type Row

The row type.

The row type.

Attributes

Inherited from:
TableBuilder

Value members

Abstract methods

def parse(xs: Iterator[Input], n: Int = ...): Try[Table]

Method to parse a table based on an iterator of Inputs.

Method to parse a table based on an iterator of Inputs.

Value parameters

n

the number of rows to drop (length of the header).

xs

the sequence of Inputs, one for each row

Attributes

Returns

an Try[Table]

Inherited and Abstract methods

protected def builder(rows: Iterator[Row], header: Header): Table

Method to construct a Table based on the given iterator of rows and the given header.

Method to construct a Table based on the given iterator of rows and the given header.

Value parameters

header

a Header object representing the table's column headers.

rows

an iterator of Row objects representing the data rows.

Attributes

Returns

the constructed Table based on the input rows and header.

Inherited from:
TableBuilder

Abstract fields

Method to define a row parser.

Method to define a row parser.

Attributes

Returns

a RowParser[Row, Input].

Concrete fields

val headerRowsToRead: Int

This indicates the number of header rows which must be read from the input. The value is usually 1 but some types of CSV file have more than one header line. If maybeHeader exists, then this number is ignored.

This indicates the number of header rows which must be read from the input. The value is usually 1 but some types of CSV file have more than one header line. If maybeHeader exists, then this number is ignored.

CONSIDER if this is really ignored when maybeHeader is defined, then we should eliminate such places where this value has an override of 0.

Attributes

Inherited fields

protected val forgiving: Boolean

If true, individual row failures are logged but do not cause the overall parse to fail.

If true, individual row failures are logged but do not cause the overall parse to fail.

Attributes

Inherited from:
TableBuilder
protected val predicate: Try[Row] => Boolean

Predicate to filter rows. Defaults to including all rows.

Predicate to filter rows. Defaults to including all rows.

Attributes

Inherited from:
TableBuilder