Releases: brick/std
Releases · brick/std
0.4.0
0.3.1
0.3.0
0.2.0
Breaking changes in CsvFileIterator
:
- now always skips empty lines; only the header line is not allowed to be empty when
$headerRow
istrue
- now throws an exception when
$headerRow
istrue
, and either or these statements is true:- the file is empty
- the header row is an empty line
- column names are not unique
- column count of a non-empty line does not match header row's column count, unless either
allowLessColumns()
and/orallowMoreColumns()
are configured, see below.
New methods in CsvFileIterator
:
allowLessColumns()
changes the behaviour of the iterator to not throw an exception if a row has less columns than the header row, and instead replace any missing column value withnull
, which was the default behaviour before this updateallowMoreColumns()
changes the behaviour of the iterator to not throw an exception if a row has more columns than the header row, and instead ignore subsequent columns, which was the default behaviour before this update
This updates aims to harden the iterator by default, while allowing a more lenient parsing if a CSV file is known to be broken in terms of column count.