Tcl Library Source Code

View Ticket
Login
Ticket UUID: 387599b3d8b34e06e42c3811646925dff911159e
Title: csv::split -alternate doesn't work as expected
Type: Bug Version: 0.8.1
Submitter: pointsman Created on: 2016-07-27 20:12:02
Subsystem: csv Assigned To: aku
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2017-05-26 18:31:33
Resolution: None Closed By: nobody
    Closed on:
Description:
package require csv
puts [csv::split -alternate {a;b""b;c} \;]

=> a b {;c}

That is with csv 0.8.1 / tcl 8.6.5.

Expected result:

a b\"b c

(as [csv::split {a;b""b;c} \;] does)

I'm aware, that csv formating (and in turn parsing) is a somewhat
vague area. So the csv::split -alternate parser does, what it does.

But it's not only, that the result for this input is rather strange
(what did eat the second "b" of the sample input, only to start with)
and that all other csv parser, I tried, did a better job. I also
think, that the result doesn't match what the documentation say
(http://core.tcl.tk/tcllib/doc/trunk/embedded/www/tcllib/files/modules/csv/csv.html#section3)