san4you88 commented 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 = 
"Santhosh-3||Updated-Santhosh-3||Venkatesh-3||Updated-Venkatesh-3||NameUpdate-3||Mobile||111-222-335||||Home||HHH-113||111-222-335";
           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 : 
Santhosh-3,Updated-Santhosh-3,Venkatesh-3,Updated-Venkatesh-3,NameUpdate-3,Mobile,111-222-335,Home,HHH-113,111-222-335
                  // Actual : 
Santhosh-3,Updated-Santhosh-3,Venkatesh-3,Updated-Venkatesh-3,NameUpdate-3,Mobile,111-222-335,|Home,HHH-113,111-222-335
               }
           }
       }
   ```
   
   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: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to