Search code examples
javacsvunivocity

Univocity parsers custom line separator


I'm reading a CSV from a legacy system that has multi line records separated by ,END.

I'm trying to use Univocity parsers to parse the CSV line by line where each 'line' runs until ,END.

I have tried using .setLineSeparator(",END"); but it seems to be limited to 2 chars.

Is there any way to use Univocity to parse with a line separator of more than 2 chars?


Solution

  • Guess it won't ever be added

    https://github.com/uniVocity/univocity-parsers/issues/307

    Allow longer line separators than two characters #307
    
    Thanks for the suggestion but it's not going to be implemented: this requires a LOT of changes, added complexity and performance overhead for a corner case that up until now no one has ever needed.
    
    Closing.