san4you88 edited a comment on pull request #76:
URL: https://github.com/apache/commons-csv/pull/76#issuecomment-912359970
Hi All,
I was testing the functionality to use string delimiter and found the
following issue.
```
public static void main(String[] args) throws Exception{
String row = "a||b||c||d||||f||g";
StringBuilder stringBuilder = new StringBuilder();
try (CSVPrinter csvPrinter = new CSVPrinter(stringBuilder,
CSVFormat.EXCEL);
CSVParser csvParser = CSVParser.parse(new
StringInputStream(row), StandardCharsets.UTF_8,
CSVFormat.Builder.create().setDelimiter("||").build())) {
for (CSVRecord csvRecord : csvParser) {
for (int i = 0; i < csvRecord.size(); i++) {
csvPrinter.print(csvRecord.get(i));
}
System.out.println(stringBuilder.toString());
//Expected : a,b,c,d,,f,g
// Actual : a,b|c,d,|f,g
}
}
}
```
The actual value is different from expected, looks like the string delimiter
doesn't work as expected when there is an empty column.
Can some1 please confirm
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]