Tk Library Source Code

View Ticket
Login
Ticket UUID: 485715
Title: csvcut example program output problem
Type: Bug Version: None
Submitter: lvirden Created on: 2001-11-26 18:25:18
Subsystem: csv Assigned To: andreas_kupries
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2001-12-12 05:03:48
Resolution: None Closed By: andreas_kupries
    Closed on: 2001-12-11 22:03:48
Description:
csvcut produces "non-standard" (whatever that means :-)
output for csv input files with fields with embedded
blanks:

$ cat /tmp/sample.csv
1,2,"this is a test",4
$ csvcut 0-4 /tmp/sample.csv
1,2,this is a test,4

Notice the quoting of the column with spaces is lost
during the cut.  If the quoted field contains a comma,
the spacing is maintained however!
User Comments: andreas_kupries added on 2001-12-12 05:03:48:
Logged In: YES 
user_id=75003

Larry, were you able to get more info on the topic ?

lvirden added on 2001-11-27 18:43:26:
Logged In: YES 
user_id=15949

the concern on my part is that I believe I have encountered
csv tools which require a column to be quoted if it contains
white space or seperation characters.  I am uncertain which
tools.  I will google for more info on this topic.

andreas_kupries added on 2001-11-27 09:29:40:
Logged In: YES 
user_id=75003

According to the FORMAT section in the manpage of csv a
value is quoted if it contains the separator character. In
the example space is not the separator character, hence no
quoting in the output. In this respect all commands in the
csv module normalize the input. I.e. they accept quoted
values even there not necessary but on output quote only
where truly required.

Does this behaviour cause problems with other tools ?