The DelimitedFormat being used to parse this delimited file, or None
if a format has not yet been inferred (in which case, no rows have yet
been returned by parseChunk
).
Parse a chunk of the input if there is any left.
Parse a chunk of the input if there is any left. If chunk is None
, then
that indicates to the parser that there will be no further input. In this
case (chunk
is None
), all remaining input will be consumed and
returned as rows (or errors).
This returns a new DelimitedParser
to use to parse the next chunk, as
well as a Vector
of all complete rows parsed from chunk
.
the next chunk of data as a String, or None if eof
Returns all unparsed data and a DelimitedParser whose state is completely reset.
Parse all chunks in the given iterator, consecutively, treating the last
chunk in chunks
as the final input.
Parse all chunks in the given iterator, consecutively, treating the last
chunk in chunks
as the final input. This will return all rows from the
input.
Completely parses file
and returns all the rows in a Vector
.
Completely parses file
and returns all the rows in a Vector
.
the TSV file on disk
the character set the TSV was encoded in
Returns an iterator that parses rows from in
as elements are
consumed.
Returns an iterator that parses rows from in
as elements are
consumed.
the character set to decode the bytes as
Returns an iterator that parses rows from reader
as elements are
consumed.
Parses an entire delimited file as a string.
An immutable parser for delimited files. This operates on chunks of input, using the
parseChunk
method. After parsing a chunk, theparseChunk
method returns a newDelimitedParser
as well as all of the complete rows parsed in that chunk. Any partially complete rows will be returned in a future call toparseChunk
in either the returnedDelimitedParser
or a future one in a chain of calls toparseChunk
.There are also convenience methods for parsing
File
s,String
s,InputStream
s,Reader
s, etc.To get an instance of a
DelimitedParser
that can be used to parse a CSV, TSV, etc file, you can use something like:If you don't know the format of your delimited file ahead of time, not much changes: