Univocity parser issue with empty string field

By | July 12, 2018
Questions:

For fixed width parsing using multiple lookahead, the empty string causes issues (i.e., fieldX=' '). So for fixed format file with only 2 records, if the first record ends with a empty string field, then this causes a issue. The last field in the record is treated as empty(null), and it does not treat the first character in the next record as a lookahead, but instead the second character. If the last field in the first record has a non-empty value (fieldX='11111'), then this is not an issue and it works. The workaround for me was to set settings.getFormat().setPadding('~') to some character not expected in the file.

Is there any settings to allow to accept empty strings and treat them as ‘ ‘ and not NULL.

Please advise.

Answers:

Leave a Reply

Your email address will not be published. Required fields are marked *