You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by bu...@apache.org on 2004/07/06 14:55:57 UTC

DO NOT REPLY [Bug 29934] New: - CSVRead can't handle blank fields

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29934>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29934

CSVRead can't handle blank fields

           Summary: CSVRead can't handle blank fields
           Product: JMeter
           Version: Nightly (Please specify date)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Main
        AssignedTo: jmeter-dev@jakarta.apache.org
        ReportedBy: chris.r.povirk@paytec.com


(checked out the CVS source today, 2004 July 6.

The CSVRead function doesn't handle blank fields.  FileRowColContainer.java uses
a StringTokenizer that does not return delimeters, so multiple delimeters are
swallowed and treated as one.  As a result, for an input file like this...

,,,
,,,3
,,2,
,,2,3
,1,,
,1,,3
,1,2,
,1,2,3
0,,,
0,,,3
0,,2,
0,,2,3
0,1,,
0,1,,3
0,1,2,
0,1,2,3

...JMeter reads it like this...

,,,
3,,,
2,,,
2,3,,
1,,,
1,3,,
1,2,,
etc.

The fix should be simple enough if we can merely change the behavior to count
every delimeter.  My concern with that is that one could conceivably have input
like this:
Smith Thomas 12345
Doe   Jane   12346
This seems rather unlikely for a couple reasons.  First, I doubt anyone would
use this format with the default delimeter of a comma, since it would look like
this...
Smith,Thomas,12345
Doe,,,Jane,,,12346
...while it seems unlikely that anyone would use spaces as a delimeter, as doing
so would cause problems for, say, a snail-mail address, which presumably include
spaces.  Also, the CSV format is, of course, common, and in my experience, ",,"
produces a blank field.

I'll post a potential fix shortly.  Let me know if there is anything I'm missing
here or if you disagree with my analysis.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org