tags:

views:

16

answers:

0

I am toying with RMySQL and trying to import a testing database using the following code:

dbSendQuery(db, statement = "LOAD DATA LOCAL INFILE '~/R/survey/pet.csv' INTO TABLE pet 
                              FIELDS TERMINATED BY '\t' 
                                     ENCLOSED BY '@'
                              IGNORE 1 LINES")

My Question is:

You can see I am using '@' for enclosing each piece of data (i.e. @hello@, @hi@ will be 2 pieces of data), I try to use paste() or cat() to replace the '@' with '"' but fails.

Most of the spreadsheet software quote the cells using '"', how can I use the '"' character when writing statement for RMySQL?

Thanks!