Tk Library Source Code

View Ticket
Login
Ticket UUID: 484118
Title: csv::split and ""
Type: Bug Version: None
Submitter: nobody Created on: 2001-11-21 10:08:02
Subsystem: csv Assigned To: andreas_kupries
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2001-12-12 05:01:55
Resolution: Invalid Closed By: andreas_kupries
    Closed on: 2001-12-11 22:01:55
Description:
csv::split {f1,"",f2}

result: f1 {"} f2
expected: f1 {} f2
User Comments: andreas_kupries added on 2001-12-12 05:01:55:
Logged In: YES 
user_id=75003

The given result is correct. The canonical CSV
representation of the lists [list f1 {} f2]
and [list f1 {"} f2] are

csv::join [list f1 {} f2]   =>  f1,,f2
csv::join [list f1 {"} f2]  =>  f1,"""",f2

Notice the following sentences in the CSV manpage:

1) If a value contains itself the separator ",",
   then it (the value) is put between "".

2) If a value contains ", it is replaced by "".

There is no ',' between the two "" in {f1,"",f2},
so rule (1) did not apply, but (2) does. This
causes the given result.