StringRowProcessor
Abstract class to extend AbstractTableParser but with Input = String. This is the normal situation where a file is a sequence of Strings, each representing one line.
Type parameters
- Row
-
the row type.
Attributes
- Graph
-
- Supertypes
Members list
Type members
Types
The input type, typically String.
The input type, typically String.
Attributes
Value members
Concrete methods
Processes an iterator of input rows with an optional header and parses them into rows.
Processes an iterator of input rows with an optional header and parses them into rows.
NOTE this will not work as required because it will still have to collect all of the individual elements inside a Try at some point. That defeats the purpose of just being able to iterate.
Depending on the presence of a fixed header and the number of rows to drop (n):
- If a fixed header is available, the processing starts after dropping the first
nrows. - If no fixed header is available but
n > 0, the firstnrows are extracted and used to parse the header, and subsequent rows are processed accordingly. - If no fixed header is available and
n <= 0, an error is returned indicating a logic issue.
This method heavily relies on implicit evidence (Joinable[Input]) to ensure the input type adheres to the necessary constraints for the transformation and joining of rows.
Value parameters
- ev
-
an implicit evidence parameter ensuring the input type adheres to the
Joinabletype class, which provides methods to combine or validate input elements during processing. - n
-
the number of initial rows to ignore (e.g., when rows are part of the header).
- xs
-
an iterator of inputs, where each element corresponds to a row of input data.
Attributes
- Returns
-
a
Trycontaining an iterator of parsedRowobjects if the parsing succeeds, or a failure if any step of the process encounters an error (e.g., invalid header or processing logic). - Definition Classes
Inherited fields
Method to determine how errors are handled.
Method to determine how errors are handled.
Attributes
- Returns
-
true if individual errors are logged but do not cause parsing to fail.
- Inherited from:
- RowProcessor
This indicates the number of header rows which must be read from the input. If maybeHeader exists, then this property is ignored.
This indicates the number of header rows which must be read from the input. If maybeHeader exists, then this property is ignored.
Attributes
- Inherited from:
- RowProcessor
This variable determines if there is a programmed, i.e., fixed, header for the parser. If its value is None, it signifies that we must look to the first line(s) of data for an appropriate header.
This variable determines if there is a programmed, i.e., fixed, header for the parser. If its value is None, it signifies that we must look to the first line(s) of data for an appropriate header.
Attributes
- Inherited from:
- RowProcessor
Value to determine whether it is acceptable to have a quoted string span more than one line.
Value to determine whether it is acceptable to have a quoted string span more than one line.
Attributes
- Returns
-
true if quoted strings may span more than one line.
- Inherited from:
- RowProcessor
Function to determine whether or not a row should be included in the table. Typically used for random sampling.
Function to determine whether or not a row should be included in the table. Typically used for random sampling.
Attributes
- Inherited from:
- RowProcessor