[jira] [Commented] (CSV-63) CSVPrinter always quotes empty string if it is the first on a line
[ https://issues.apache.org/jira/browse/CSV-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16176806#comment-16176806 ] Jeff Evans commented on CSV-63: --- Any update on this? The PR submitted by Thai looks great (to my non-contributor eye) and would provide a much welcomed fix. > CSVPrinter always quotes empty string if it is the first on a line > -- > > Key: CSV-63 > URL: https://issues.apache.org/jira/browse/CSV-63 > Project: Commons CSV > Issue Type: Improvement > Components: Printer >Reporter: Sebb >Priority: Minor > Fix For: Patch Needed, 1.x > > > CSVPrinter always quotes the empty string if it is the first on a line. > This is inconsistent. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (CSV-63) CSVPrinter always quotes empty string if it is the first on a line
[ https://issues.apache.org/jira/browse/CSV-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15734584#comment-15734584 ] Thai H commented on CSV-63: --- I've created a pull request (https://github.com/apache/commons-csv/pull/14) for this issue. Can someone help to review it? Thanks. -Thai > CSVPrinter always quotes empty string if it is the first on a line > -- > > Key: CSV-63 > URL: https://issues.apache.org/jira/browse/CSV-63 > Project: Commons CSV > Issue Type: Improvement > Components: Printer >Reporter: Sebb >Priority: Minor > Fix For: Patch Needed, 1.x > > > CSVPrinter always quotes the empty string if it is the first on a line. > This is inconsistent. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CSV-63) CSVPrinter always quotes empty string if it is the first on a line
[ https://issues.apache.org/jira/browse/CSV-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15656894#comment-15656894 ] Benedikt Ritter commented on CSV-63: [~lynge] I don't have any concrete plans to work on this issue. If you have a fix for this, I can review and apply it. Best regards, Benedikt > CSVPrinter always quotes empty string if it is the first on a line > -- > > Key: CSV-63 > URL: https://issues.apache.org/jira/browse/CSV-63 > Project: Commons CSV > Issue Type: Improvement > Components: Printer >Reporter: Sebb >Priority: Minor > Fix For: Patch Needed, 1.x > > > CSVPrinter always quotes the empty string if it is the first on a line. > This is inconsistent. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CSV-63) CSVPrinter always quotes empty string if it is the first on a line
[ https://issues.apache.org/jira/browse/CSV-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15656782#comment-15656782 ] Morten Lynge commented on CSV-63: - [~britter] will you look into this issue? > CSVPrinter always quotes empty string if it is the first on a line > -- > > Key: CSV-63 > URL: https://issues.apache.org/jira/browse/CSV-63 > Project: Commons CSV > Issue Type: Improvement > Components: Printer >Reporter: Sebb >Priority: Minor > Fix For: Patch Needed, 1.x > > > CSVPrinter always quotes the empty string if it is the first on a line. > This is inconsistent. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CSV-63) CSVPrinter always quotes empty string if it is the first on a line
[ https://issues.apache.org/jira/browse/CSV-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15646909#comment-15646909 ] Morten Lynge commented on CSV-63: - The issue is still in 1.4. {code} @Test public void quotesOnFirstElement() throws IOException { StringWriter writer = new StringWriter(); CSVPrinter printer = new CSVPrinter(writer, CSVFormat.EXCEL.withDelimiter(';')); printer.printRecord("", "", ""); printer.close(); assertEquals(";;", writer.toString()); // yields org.junit.ComparisonFailure: expected:<[];;> but was:<[""];;> } {code} {code:xml} org.apache.commons commons-csv 1.4 {code} > CSVPrinter always quotes empty string if it is the first on a line > -- > > Key: CSV-63 > URL: https://issues.apache.org/jira/browse/CSV-63 > Project: Commons CSV > Issue Type: Improvement > Components: Printer >Reporter: Sebb >Priority: Minor > Fix For: Patch Needed, 1.x > > > CSVPrinter always quotes the empty string if it is the first on a line. > This is inconsistent. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CSV-63) CSVPrinter always quotes empty string if it is the first on a line
[ https://issues.apache.org/jira/browse/CSV-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15342505#comment-15342505 ] Benedikt Ritter commented on CSV-63: Hello [~sureshssarda], I'm not sure. One way to help here would be to create a test which show whether the issue still exists. Have a look as the CSVPrinter tests and try to come up with a test for this problem. If it fails, we know what we need to fix. If not, the issue has been fixed in the mean time. Benedikt > CSVPrinter always quotes empty string if it is the first on a line > -- > > Key: CSV-63 > URL: https://issues.apache.org/jira/browse/CSV-63 > Project: Commons CSV > Issue Type: Improvement > Components: Printer >Reporter: Sebb >Priority: Minor > Fix For: Patch Needed, 1.x > > > CSVPrinter always quotes the empty string if it is the first on a line. > This is inconsistent. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CSV-63) CSVPrinter always quotes empty string if it is the first on a line
[ https://issues.apache.org/jira/browse/CSV-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15340948#comment-15340948 ] Suresh Sarda commented on CSV-63: - Is this issue still there? I am thinking to fix it. Only if I could understand what the conclusion is. > CSVPrinter always quotes empty string if it is the first on a line > -- > > Key: CSV-63 > URL: https://issues.apache.org/jira/browse/CSV-63 > Project: Commons CSV > Issue Type: Improvement > Components: Printer >Reporter: Sebb >Priority: Minor > Fix For: Patch Needed, 1.x > > > CSVPrinter always quotes the empty string if it is the first on a line. > This is inconsistent. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CSV-63) CSVPrinter always quotes empty string if it is the first on a line
[ https://issues.apache.org/jira/browse/CSV-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14635731#comment-14635731 ] tim hood commented on CSV-63: - This seems to work or have I got the wrong idea. @SuppressWarnings("static-method") @Test public void test() { try { final CSVFormat format = CSVFormat.DEFAULT.withEscape('\\').withQuoteMode(QuoteMode.NONE); final StringWriter out = new StringWriter(); try (CSVPrinter printer = new CSVPrinter(out, format)) { printer.printRecord(Arrays.asList(new String[] { "", "", "" })); } final String result = out.toString().trim(); System.out.println(">>" + result + "<<"); Assert.assertEquals(2, result.length()); } catch (final IOException e) { Assert.fail(e.getMessage()); } } > CSVPrinter always quotes empty string if it is the first on a line > -- > > Key: CSV-63 > URL: https://issues.apache.org/jira/browse/CSV-63 > Project: Commons CSV > Issue Type: Improvement > Components: Printer >Reporter: Sebb >Priority: Minor > Fix For: Patch Needed, 1.x > > > CSVPrinter always quotes the empty string if it is the first on a line. > This is inconsistent. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CSV-63) CSVPrinter always quotes empty string if it is the first on a line
[ https://issues.apache.org/jira/browse/CSV-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14577919#comment-14577919 ] Qiang Li commented on CSV-63: - Made a simple change to only quote for one empty value as Trejkaz suggested https://github.com/qiangli/commons-csv/tree/csv-63 > CSVPrinter always quotes empty string if it is the first on a line > -- > > Key: CSV-63 > URL: https://issues.apache.org/jira/browse/CSV-63 > Project: Commons CSV > Issue Type: Improvement > Components: Printer >Reporter: Sebb >Priority: Minor > Fix For: Patch Needed, 1.x > > > CSVPrinter always quotes the empty string if it is the first on a line. > This is inconsistent. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CSV-63) CSVPrinter always quotes empty string if it is the first on a line
[ https://issues.apache.org/jira/browse/CSV-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14282093#comment-14282093 ] Trejkaz commented on CSV-63: Another vote for this feature from me. I see the need to quote it when there is one blank value to distinguish it from a blank line, but I don't see the need to quote it when there are 2+ values on the line, even if all values are blank. Another option which would have been fine by me is to write a single comma (it was one of the old tactics we used to use in the past to get around the same thing...) > CSVPrinter always quotes empty string if it is the first on a line > -- > > Key: CSV-63 > URL: https://issues.apache.org/jira/browse/CSV-63 > Project: Commons CSV > Issue Type: Improvement > Components: Printer >Reporter: Sebb >Priority: Minor > Fix For: Patch Needed, 1.x > > > CSVPrinter always quotes the empty string if it is the first on a line. > This is inconsistent. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (CSV-63) CSVPrinter always quotes empty string if it is the first on a line
[ https://issues.apache.org/jira/browse/CSV-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13229686#comment-13229686 ] Emmanuel Bourg commented on CSV-63: --- There is also the possibility that the format allows fields to be encapsulated even if it doesn't require it due to a special character. That's the case of RFC 4180. We might take into account the value of the {{emptyLinesIgnored}} property of the format. If empty lines are not ignored, it's safe to not quote the value, otherwise it must be quoted to ensure the file generated can be read with the same format. > CSVPrinter always quotes empty string if it is the first on a line > -- > > Key: CSV-63 > URL: https://issues.apache.org/jira/browse/CSV-63 > Project: Commons CSV > Issue Type: Bug > Components: Printer >Reporter: Sebb > > CSVPrinter always quotes the empty string if it is the first on a line. > This is inconsistent. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CSV-63) CSVPrinter always quotes empty string if it is the first on a line
[ https://issues.apache.org/jira/browse/CSV-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13229567#comment-13229567 ] Sebb commented on CSV-63: - I don't think we should take account of the number of fields, because again that is inconsistent. A field should be encapsulated (quoted) if either the format always encapsulates or the value requires encapsulation. > CSVPrinter always quotes empty string if it is the first on a line > -- > > Key: CSV-63 > URL: https://issues.apache.org/jira/browse/CSV-63 > Project: Commons CSV > Issue Type: Bug >Reporter: Sebb > > CSVPrinter always quotes the empty string if it is the first on a line. > This is inconsistent. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CSV-63) CSVPrinter always quotes empty string if it is the first on a line
[ https://issues.apache.org/jira/browse/CSV-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13229558#comment-13229558 ] Emmanuel Bourg commented on CSV-63: --- Then let's quote the first field only if quotes are enabled and the record contains only one field. > CSVPrinter always quotes empty string if it is the first on a line > -- > > Key: CSV-63 > URL: https://issues.apache.org/jira/browse/CSV-63 > Project: Commons CSV > Issue Type: Bug >Reporter: Sebb > > CSVPrinter always quotes the empty string if it is the first on a line. > This is inconsistent. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CSV-63) CSVPrinter always quotes empty string if it is the first on a line
[ https://issues.apache.org/jira/browse/CSV-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13229532#comment-13229532 ] Sebb commented on CSV-63: - Yes, I saw that, but it does not apply to records with multiple values. Also, I just tried creating a one-column spreadsheet in OpenOffice Calc - it saves an empty row as an empty line. It reads the file back successfully, recreating the empty row. > CSVPrinter always quotes empty string if it is the first on a line > -- > > Key: CSV-63 > URL: https://issues.apache.org/jira/browse/CSV-63 > Project: Commons CSV > Issue Type: Bug >Reporter: Sebb > > CSVPrinter always quotes the empty string if it is the first on a line. > This is inconsistent. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CSV-63) CSVPrinter always quotes empty string if it is the first on a line
[ https://issues.apache.org/jira/browse/CSV-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13229514#comment-13229514 ] Emmanuel Bourg commented on CSV-63: --- There is a comment in the code explaining why: {code} // always quote an empty token that is the first // on the line, as it may be the only thing on the // line. If it were not quoted in that case, // an empty line has no tokens. {code} > CSVPrinter always quotes empty string if it is the first on a line > -- > > Key: CSV-63 > URL: https://issues.apache.org/jira/browse/CSV-63 > Project: Commons CSV > Issue Type: Bug >Reporter: Sebb > > CSVPrinter always quotes the empty string if it is the first on a line. > This is inconsistent. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira