From edd at debian.org  Tue Sep 19 21:09:09 2017
From: edd at debian.org (Dirk Eddelbuettel)
Date: Tue, 19 Sep 2017 14:09:09 -0500
Subject: [Rd] what do you think about write.table(... qmethod = "excel")?
In-Reply-To: <CAErODj-3gXgtoDZf8LMiw=1eQZOfUeTy=-vqr1pgstW-JdBFUw@mail.gmail.com>
References: <CAErODj-3gXgtoDZf8LMiw=1eQZOfUeTy=-vqr1pgstW-JdBFUw@mail.gmail.com>
Message-ID: <22977.27478.303.764144@bud.eddelbuettel.com>


On 19 September 2017 at 12:04, Paul Johnson wrote:
| They showed me a CSV file from Excel that looked like this
| 
| x1,x2,x3,x4 5 6
| fred,barney,betty,x
| bambam,"fred,wilma",pebbles,y
| 
| Note how the quotes only happen on row 2 column 2. I was surprised it
| did that, but now I have some pressure to write a csv maker that has
| that structure.  Its weird, even when there are spaces in values there
| are no quotation marks.
| 
| Has anybody done this and verified that it matches CSV from MS Excel?
| If I succeed will you consider a patch?

R> data.table::fread("/tmp/paul.csv")
       x1         x2      x3 x4 5 6
1:   fred     barney   betty      x
2: bambam fred,wilma pebbles      y
R> data.table::fread("/tmp/paul.csv")
       x1         x2      x3 x4
1:   fred     barney   betty  x
2: bambam fred,wilma pebbles  y
R> 

The only difference is that between calls one and two, I removed the stray
    "5 6"
from the first line.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



[Rd] what do you think about write.table(... qmethod = "excel")?
Dirk Eddelbuettel