[jira] Created: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

classic Classic list List threaded Threaded
44 messages Options
123
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
----------------------------------------------------------------------------------------------------------------------------

                 Key: SANDBOX-210
                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
             Project: Commons Sandbox
          Issue Type: Bug
          Components: CSV
            Reporter: Ilya Egoshin


original line: My line is containing ", symbols
line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"

as a result when you will try to open that file in the excell you see text inside two cells:
1 cell: My line containing \
2 cell: symbols

is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625607#action_12625607 ]

pcsri1956 edited comment on SANDBOX-210 at 8/25/08 7:49 PM:
------------------------------------------------------

This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically EXCEL_STRATEGY

private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {
        sb.append('"').append(c);                      // changed from  sb.append('\\').append(c);  
        continue;
................
      }
      }

      was (Author: pcsri1956):
    This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically EXCEL_STRATEGY

private String escapeAndQuote(String value) {
.........    
    StringBuffer sb = new StringBuffer(value.length() + count);
    sb.append(strategy.getEncapsulator());
    for (int i = 0; i < value.length(); i++) {
      char c = value.charAt(i);

      if (c == strategy.getEncapsulator()) {
        sb.append('"').append(c);                      // changed from  sb.append('\\').append(c);  
        continue;
      }
      switch (c) {
        case '\n' :
          sb.append("\\n");
          break;
        case '\r' :
          sb.append("\\r");
          break;
        case '\\' :
          sb.append("\\\\");
          break;
        default :
          sb.append(c);
      }
    }
    sb.append(strategy.getEncapsulator());
    return sb.toString();
  }

}
 

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625607#action_12625607 ]

Ram commented on SANDBOX-210:
-----------------------------

This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically EXCEL_STRATEGY

private String escapeAndQuote(String value) {
.........    
    StringBuffer sb = new StringBuffer(value.length() + count);
    sb.append(strategy.getEncapsulator());
    for (int i = 0; i < value.length(); i++) {
      char c = value.charAt(i);

      if (c == strategy.getEncapsulator()) {
        sb.append('"').append(c);                      // changed from  sb.append('\\').append(c);  
        continue;
      }
      switch (c) {
        case '\n' :
          sb.append("\\n");
          break;
        case '\r' :
          sb.append("\\r");
          break;
        case '\\' :
          sb.append("\\\\");
          break;
        default :
          sb.append(c);
      }
    }
    sb.append(strategy.getEncapsulator());
    return sb.toString();
  }

}

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625607#action_12625607 ]

pcsri1956 edited comment on SANDBOX-210 at 8/25/08 7:51 PM:
------------------------------------------------------

This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically EXCEL_STRATEGY

private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                             sb.append('"').append(c);                    

                      // changed from  sb.append('\\').append(c);  
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        continue;
................
      }
      }

      was (Author: pcsri1956):
    This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically EXCEL_STRATEGY

private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

                             sb.append('"').append(c);                      // changed from  sb.append('\\').append(c);  
       
        continue;
................
      }
      }
 

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625607#action_12625607 ]

pcsri1956 edited comment on SANDBOX-210 at 8/25/08 7:50 PM:
------------------------------------------------------

This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically EXCEL_STRATEGY

private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

                             sb.append('"').append(c);                      // changed from  sb.append('\\').append(c);  
       
        continue;
................
      }
      }

      was (Author: pcsri1956):
    This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically EXCEL_STRATEGY

private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

        sb.append('"').append(c);                      // changed from  sb.append('\\').append(c);  
       
        continue;
................
      }
      }
 

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625607#action_12625607 ]

pcsri1956 edited comment on SANDBOX-210 at 8/25/08 7:49 PM:
------------------------------------------------------

This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically EXCEL_STRATEGY

private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

        sb.append('"').append(c);                      // changed from  sb.append('\\').append(c);  
       
        continue;
................
      }
      }

      was (Author: pcsri1956):
    This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically EXCEL_STRATEGY

private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {
        sb.append('"').append(c);                      // changed from  sb.append('\\').append(c);  
        continue;
................
      }
      }
 

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625607#action_12625607 ]

pcsri1956 edited comment on SANDBOX-210 at 8/25/08 7:52 PM:
------------------------------------------------------

This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically for EXCEL_STRATEGY

private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                             sb.append('"').append(c);                    

                      // COMMENT ------------> changed from  sb.append('\\').append(c);  
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        continue;
................
      }
      }

      was (Author: pcsri1956):
    This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically EXCEL_STRATEGY

private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                             sb.append('"').append(c);                    

                      // changed from  sb.append('\\').append(c);  
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        continue;
................
      }
      }
 

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625607#action_12625607 ]

pcsri1956 edited comment on SANDBOX-210 at 8/25/08 7:53 PM:
------------------------------------------------------

This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically for EXCEL_STRATEGY

In CSVPrinter class ..
private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                             sb.append('"').append(c);                    

                      // COMMENT ------------> changed from  sb.append('\\').append(c);  
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        continue;
................
      }
      }

      was (Author: pcsri1956):
    This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically for EXCEL_STRATEGY

private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                             sb.append('"').append(c);                    

                      // COMMENT ------------> changed from  sb.append('\\').append(c);  
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        continue;
................
      }
      }
 

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625607#action_12625607 ]

pcsri1956 edited comment on SANDBOX-210 at 8/25/08 7:56 PM:
------------------------------------------------------

This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically for EXCEL_STRATEGY

In CSVPrinter class ..
private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                             sb.append('"').append(c);                    

                      // COMMENT ------------> changed from {color:red}  sb.append('\\').append(c);  {color}
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        continue;
................
      }
      }

      was (Author: pcsri1956):
    This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically for EXCEL_STRATEGY

In CSVPrinter class ..
private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                             sb.append('"').append(c);                    

                      // COMMENT ------------> changed from  sb.append('\\').append(c);  
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        continue;
................
      }
      }
 

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625607#action_12625607 ]

pcsri1956 edited comment on SANDBOX-210 at 8/25/08 7:57 PM:
------------------------------------------------------

This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically for EXCEL_STRATEGY

In CSVPrinter class ..
private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

\\
                             sb.append('"').append(c);                    
\\
                      // COMMENT ------------> changed from {color:red}  sb.append('\\').append(c);  {color}
 \\
        continue;
................
      }
      }

      was (Author: pcsri1956):
    This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically for EXCEL_STRATEGY

In CSVPrinter class ..
private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                             sb.append('"').append(c);                    

                      // COMMENT ------------> changed from {color:red}  sb.append('\\').append(c);  {color}
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        continue;
................
      }
      }
 

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625607#action_12625607 ]

pcsri1956 edited comment on SANDBOX-210 at 8/25/08 8:01 PM:
------------------------------------------------------

This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically for EXCEL_STRATEGY

{code:title=Bar.java|borderStyle=solid}
// change sb.append('\\')  to sb.append('"')
private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

\\
                             sb.append('"').append(c);                    
\\
            // changed from {color:red}  sb.append('\\').append(c);  {color}
 \\
        continue;
................
      }
      }

{code}

      was (Author: pcsri1956):
    This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically for EXCEL_STRATEGY

In CSVPrinter class ..
private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

\\
                             sb.append('"').append(c);                    
\\
                      // COMMENT ------------> changed from {color:red}  sb.append('\\').append(c);  {color}
 \\
        continue;
................
      }
      }
 

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625607#action_12625607 ]

pcsri1956 edited comment on SANDBOX-210 at 8/25/08 8:02 PM:
------------------------------------------------------

This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically for EXCEL_STRATEGY

{code:title=CSVPrinter.java|borderStyle=solid}
// change sb.append('\\')  to sb.append('"')
private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

             sb.append('"').append(c);                    
           
           // changed from sb.append('\\').append(c);
 
             continue;
................
      }
      }

{code}

      was (Author: pcsri1956):
    This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically for EXCEL_STRATEGY

{code:title=Bar.java|borderStyle=solid}
// change sb.append('\\')  to sb.append('"')
private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

\\
                             sb.append('"').append(c);                    
\\
            // changed from {color:red}  sb.append('\\').append(c);  {color}
 \\
        continue;
................
      }
      }

{code}
 

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625607#action_12625607 ]

pcsri1956 edited comment on SANDBOX-210 at 8/25/08 8:03 PM:
------------------------------------------------------

This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically for EXCEL_STRATEGY

{code:title=CSVPrinter.java|borderStyle=solid}
// change sb.append('\\')  to sb.append('"')
private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

             sb.append('"').append(c);                    
           
           // changed from sb.append('\\').append(c); [ Change only the above line]
 
             continue;
................
      }
      }

{code}

      was (Author: pcsri1956):
    This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically for EXCEL_STRATEGY

{code:title=CSVPrinter.java|borderStyle=solid}
// change sb.append('\\')  to sb.append('"')
private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

             sb.append('"').append(c);                    
           
           // changed from sb.append('\\').append(c);
 
             continue;
................
      }
      }

{code}
 

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ram updated SANDBOX-210:
------------------------

    Attachment: CSVPrinter.java

My CSVPrinter.java file which works. This is basically for EXCEL_STRATEGY. For other strategies fallback to procedure is required.

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>         Attachments: CSVPrinter.java
>
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625614#action_12625614 ]

pcsri1956 edited comment on SANDBOX-210 at 8/25/08 8:11 PM:
------------------------------------------------------

My CSVPrinter.java file which works. This is basically for EXCEL_STRATEGY. For other strategies fallback to old procedure is required.

      was (Author: pcsri1956):
    My CSVPrinter.java file which works. This is basically for EXCEL_STRATEGY. For other strategies fallback to procedure is required.
 

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>         Attachments: CSVPrinter.java
>
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625726#action_12625726 ]

Ilya Egoshin commented on SANDBOX-210:
--------------------------------------

Hi pcsri1956,

Are you sure it's the best way, or maybe this will be better:

// change sb.append('\\')  to sb.append('"')
private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

             sb.append(c).append(c);                    
           
           // changed from sb.append('\\').append(c); [ Change only the above line]
 
             continue;
................
      }
      }

so no matter what is encapsulator " or something else it will always double it.

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>         Attachments: CSVPrinter.java
>
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625607#action_12625607 ]

pcsri1956 edited comment on SANDBOX-210 at 8/26/08 6:51 AM:
------------------------------------------------------

This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically for EXCEL_STRATEGY

{code:title=CSVPrinter.java|borderStyle=solid}
// change sb.append('\\')  to sb.append('"')
private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

             sb.append('"').append(c);                    
           
           // changed from sb.append('\\').append(c);



 case '\\' :
          sb.append("\\");
           
         // changed from //// to //
   
          continue;
................
      }
      }

{code}

      was (Author: pcsri1956):
    This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically for EXCEL_STRATEGY

{code:title=CSVPrinter.java|borderStyle=solid}
// change sb.append('\\')  to sb.append('"')
private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

             sb.append('"').append(c);                    
           
           // changed from sb.append('\\').append(c); [ Change only the above line]
 
             continue;
................
      }
      }

{code}
 

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>         Attachments: CSVPrinter.java
>
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625607#action_12625607 ]

pcsri1956 edited comment on SANDBOX-210 at 8/26/08 6:51 AM:
------------------------------------------------------

This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically for EXCEL_STRATEGY

{code:title=CSVPrinter.java|borderStyle=solid}
// change sb.append('\\')  to sb.append('"')
private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

             sb.append('"').append(c);                    
           
           // changed from sb.append('\\').append(c);



         case '\\' :
          sb.append("\\");
           
         // changed from //// to //
   
          continue;
................
      }
      }

{code}

      was (Author: pcsri1956):
    This issue happens in CSVPrinter class. Here is how I fixed it. Look in the comment below where change is suggested specifically for EXCEL_STRATEGY

{code:title=CSVPrinter.java|borderStyle=solid}
// change sb.append('\\')  to sb.append('"')
private String escapeAndQuote(String value) {
.........    
          if (c == strategy.getEncapsulator()) {

             sb.append('"').append(c);                    
           
           // changed from sb.append('\\').append(c);



 case '\\' :
          sb.append("\\");
           
         // changed from //// to //
   
          continue;
................
      }
      }

{code}
 

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>         Attachments: CSVPrinter.java
>
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ram updated SANDBOX-210:
------------------------

    Attachment:     (was: CSVPrinter.java)

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>         Attachments: CSVPrinter.java
>
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (SANDBOX-210) Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/SANDBOX-210?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ram updated SANDBOX-210:
------------------------

    Attachment: CSVPrinter.java

The CSV that Excel outputs differs from the standard in several respects:


Leading and trailing whitespace is significant.
A backslash is not a special character and is not used to escape anything.
Quotes inside quoted strings are escaped with a double quote rather than a backslash.

> Commons CSV EXCELL_STRATEGY is reading CSV files with double quote and comma properly but not writing them back the same way
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-210
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-210
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Ilya Egoshin
>         Attachments: CSVPrinter.java
>
>
> original line: My line is containing ", symbols
> line in CSV file after "Save as CSV" in Excell: "My line containing "", symbols"
> line is CSV file as output from CSVPrinter with EXCELL_STRATEGY: "My line containing \", symbols"
> as a result when you will try to open that file in the excell you see text inside two cells:
> 1 cell: My line containing \
> 2 cell: symbols
> is it again Microsoft "features", that are "improving" RFC?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

123