Skip to content
Prev 316173 / 398502 Next

read.csv quotes within fields

On 13-01-25 4:37 PM, Tim Howard wrote:
What you say doesn't make sense.  Let me paraphrase:

"The folks who sent me the data created a weird, non-standard .csv file. 
  You'd think read.csv() could handle it."

The standard way to handle quotes in strings is to double them.  They 
didn't, so you've got a weird file on your hands.

You can probably fix it by doing a global substitution of all "backslash 
doublequote" pairs with "doublequote doublequote".  Unless they have 
some "backslash backslash doublequote" triples that they want you to 
interpret as "backslash doublequote".  Or some other weirdness.

I'd suggest you try the global subst mentioned above. or ask them for 
data in a reasonably standardized format.

Duncan Murdoch