[jira] [Commented] (CSV-84) Comment handling

2012-03-26 Thread Emmanuel Bourg (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/CSV-84?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13238879#comment-13238879
 ] 

Emmanuel Bourg commented on CSV-84:
---

That's most likely unintentional. This case is not covered by the tests, and 
CSVPrinter always output the comments on a new line.

> Comment handling
> 
>
> Key: CSV-84
> URL: https://issues.apache.org/jira/browse/CSV-84
> Project: Commons CSV
>  Issue Type: New Feature
>Reporter: Sebb
>
> Comment handling is not currently fully documented / tested.
> There are several possible situations:
> 1) trailing comment following one or more values
> 2) comment marker starts in the first column
> 3) comment marker starts in the first non-whitespace column
> How should these be handled?
> 1) The trailing comment should be ignored
> 2) Entire line should be ignored, i.e. don't treat it as a blank line
> 3) This is trickier: if whitespace is being trimmed, treat as 2, else treat 
> as 1, i.e. there is a single value containing whitespace
> It might also be useful to consider returning comments to the application 
> program as part of CSVRecord.

--
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-84) Comment handling

2012-03-26 Thread Sebb (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/CSV-84?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13238874#comment-13238874
 ] 

Sebb commented on CSV-84:
-

I don't know if there are formats with inline comments.
The code currently recognises comments at the start of a value as well as at 
the start of a record. 
This behaviour may be unintentional.

I agree that empty lines are generally not needed, but a comment line may not 
be useless.

> Comment handling
> 
>
> Key: CSV-84
> URL: https://issues.apache.org/jira/browse/CSV-84
> Project: Commons CSV
>  Issue Type: New Feature
>Reporter: Sebb
>
> Comment handling is not currently fully documented / tested.
> There are several possible situations:
> 1) trailing comment following one or more values
> 2) comment marker starts in the first column
> 3) comment marker starts in the first non-whitespace column
> How should these be handled?
> 1) The trailing comment should be ignored
> 2) Entire line should be ignored, i.e. don't treat it as a blank line
> 3) This is trickier: if whitespace is being trimmed, treat as 2, else treat 
> as 1, i.e. there is a single value containing whitespace
> It might also be useful to consider returning comments to the application 
> program as part of CSVRecord.

--
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-84) Comment handling

2012-03-26 Thread Emmanuel Bourg (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/CSV-84?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13238843#comment-13238843
 ] 

Emmanuel Bourg commented on CSV-84:
---

I have never seen trailing comments in the wild, is there an application 
actually producing this kind of files?

Regarding case 3, I would handle it exactly like the case 2. There is no point 
returning an empty line. Empty lines are useless in almost every case.

> Comment handling
> 
>
> Key: CSV-84
> URL: https://issues.apache.org/jira/browse/CSV-84
> Project: Commons CSV
>  Issue Type: New Feature
>Reporter: Sebb
>
> Comment handling is not currently fully documented / tested.
> There are several possible situations:
> 1) trailing comment following one or more values
> 2) comment marker starts in the first column
> 3) comment marker starts in the first non-whitespace column
> How should these be handled?
> 1) The trailing comment should be ignored
> 2) Entire line should be ignored, i.e. don't treat it as a blank line
> 3) This is trickier: if whitespace is being trimmed, treat as 2, else treat 
> as 1, i.e. there is a single value containing whitespace
> It might also be useful to consider returning comments to the application 
> program as part of CSVRecord.

--
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-84) Comment handling

2012-03-24 Thread Sebb (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/CSV-84?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13237549#comment-13237549
 ] 

Sebb commented on CSV-84:
-

At present (r1304503), the comment introducer is not recognised whilst 
processing a value.
It is only recognised at the start of a value.

This seems wrong, as it makes it impossible to add a trailing comment to the 
end of a record without adding a preceeding delimiter. This is not consistent, 
see below:

{code}
# No comment following, 4 values found
a,b,c,d
d,e,f,g# comment treated as part of 4th value
h,i,j,k,# this will be recognised as a comment following 4 fields
l,m,n,o,
# previous line should have 5 fields but actually gets merged to previous line.
{code}

Comments currently only work correctly at the start of a record.

> Comment handling
> 
>
> Key: CSV-84
> URL: https://issues.apache.org/jira/browse/CSV-84
> Project: Commons CSV
>  Issue Type: New Feature
>Reporter: Sebb
>
> Comment handling is not currently fully documented / tested.
> There are several possible situations:
> 1) trailing comment following one or more values
> 2) comment marker starts in the first column
> 3) comment marker starts in the first non-whitespace column
> How should these be handled?
> 1) The trailing comment should be ignored
> 2) Entire line should be ignored, i.e. don't treat it as a blank line
> 3) This is trickier: if whitespace is being trimmed, treat as 2, else treat 
> as 1, i.e. there is a single value containing whitespace
> It might also be useful to consider returning comments to the application 
> program as part of CSVRecord.

--
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