Re: [R] read.csv and field containing single quotes

2012-03-27 Thread Rainer M Krug
On 27/03/12 01:09, Benilton Carvalho wrote: > I need to read in csv files, created by 3rd party, with fields > containing single quotes (as shown below). > > "header1","header2","header3","header4" > "field1r1","field2r1","field3r1","field4r1" > "field1r2","field2r2","field3r2PartA), field3r2PartB

Re: [R] read.csv and field containing single quotes

2012-03-27 Thread Benilton Carvalho
Thanks Henrique... giving it a try now, but it'll take a good while, given the file size. Cheers, b On 27 March 2012 02:35, Henrique Dallazuanna wrote: > Benilton, > > Try this: > > read.table(textConnection(gsub('","', "','", gsub('^\"|\"$', "'", > readLines('../teste.csv', sep = ',', quo

Re: [R] read.csv and field containing single quotes

2012-03-26 Thread Henrique Dallazuanna
Benilton, Try this: read.table(textConnection(gsub('","', "','", gsub('^\"|\"$', "'", readLines('../teste.csv', sep = ',', quote = "'", header = TRUE) On Mon, Mar 26, 2012 at 8:09 PM, Benilton Carvalho wrote: > I need to read in csv files, created by 3rd party, with fields > containing sing

[R] read.csv and field containing single quotes

2012-03-26 Thread Benilton Carvalho
I need to read in csv files, created by 3rd party, with fields containing single quotes (as shown below). "header1","header2","header3","header4" "field1r1","field2r1","field3r1","field4r1" "field1r2","field2r2","field3r2PartA), field3r2PartB Very" Long","field4r2" "field1r3","field2r3","field3r3"