[
https://issues.apache.org/jira/browse/CSV-206?focusedWorklogId=646222&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-646222
]
ASF GitHub Bot logged work on CSV-206:
--------------------------------------
Author: ASF GitHub Bot
Created on: 03/Sep/21 08:43
Start Date: 03/Sep/21 08:43
Worklog Time Spent: 10m
Work Description: 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";
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
// Actual : a,b|c,d
}
}
}
```
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 646222)
Time Spent: 2h 40m (was: 2.5h)
> Add support for String delimiters #76
> -------------------------------------
>
> Key: CSV-206
> URL: https://issues.apache.org/jira/browse/CSV-206
> Project: Commons CSV
> Issue Type: Improvement
> Reporter: jefferyyuan
> Priority: Major
> Labels: commons, commons-csv, csv, csvparser
> Fix For: 1.9.0
>
> Time Spent: 2h 40m
> Remaining Estimate: 0h
>
> It's not uncommon that we use multiple-characters delimiter to separate
> columns in CVS: such as: [|]
> Sometimes, we have no choice as third-party defines the csv format like that.
> It would be great if apache commons.csv supports this function.
> I did some google search: seems there is no java library that supports use
> multiple-characters as the column separator.
> But the C# CsvHelper does
> https://github.com/JoshClose/CsvHelper
--
This message was sent by Atlassian Jira
(v8.3.4#803005)