commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <>
Subject [jira] [Commented] (CSV-222) invalid char between encapsulated token and delimiter
Date Wed, 04 Apr 2018 14:42:01 GMT


Gary Gregory commented on CSV-222:

The issue you initially described talked about special characters in the record separator,
not the column delimiter.
The column delimiter is currently limited to a single character. There is a separate ticket
to enhance the column delimiter to a String instead of a char.

> invalid char between encapsulated token and delimiter
> -----------------------------------------------------
>                 Key: CSV-222
>                 URL:
>             Project: Commons CSV
>          Issue Type: Bug
>          Components: Parser
>    Affects Versions: 1.4
>            Reporter: Patrick G├Ąckle
>            Priority: Major
>         Attachments: faulty.csv
> When trying to read the file [^faulty.csv] and parse it I get the following error:
> {code}
> (line 1) invalid char between encapsulated token and delimiter
> 	at org.apache.commons.csv.Lexer.parseEncapsulatedToken(
> 	at org.apache.commons.csv.Lexer.nextToken(
> 	at org.apache.commons.csv.CSVParser.nextRecord(
> 	at org.apache.commons.csv.CSVParser.initializeHeader(
> 	at org.apache.commons.csv.CSVParser.<init>(
> 	at org.apache.commons.csv.CSVParser.<init>(
> 	at org.apache.commons.csv.CSVFormat.parse(
> {code}
> The line of code is the parsing part returning the iterator of it:
> {code:java}
> csvFormat = CSVFormat.DEFAULT.withHeader().withDelimiter(';').withIgnoreHeaderCase();
> iterator = csvFormat.parse(reader).iterator();
> {code}
> The invalid char is the contained SOH and STX non printable characters at the end of
> I debugged through the source of this and ran into the Exception in the Lexer not handling
these special characters
> Unfortunately I'm not able to provide some hints on fixing this as I'm not familiar with
these type of characters and what behaviour they should have.
> Sincerely

This message was sent by Atlassian JIRA

View raw message