2

When converting data to csv Excel normally encloses categorical variables which contain commas in quotation marks. For example: \"MÉ******, ****¿.

When using the read.csv.sql function, I'm having huge issues with handling the commas, and the execution of the code get frequently halted due to this.

When using the read.csv function I don't have this problem, and this is because of the way the function uses the quote argument.

Does Anyone know how to replicate the same behaviour with read.csv.sql?

lmo
  • 37,904
  • 9
  • 56
  • 69
  • 1
    You can preprocess your input using the `filter` argument of `read.csv.sql` Search for the word filter on the home page for several examples -- https://github.com/ggrothendieck/sqldf – G. Grothendieck May 11 '16 at 01:31
  • I've tried the documentation, data show commas within strings in this way: ,\"JAY, DOREEN A\". If I filter using the example in the documentation: filter = "gawk -v osep=; -f csv.awk" (I know it may not be right) I get the following error: "'gawk' is not recognized as an internal or external command, operable program or batch file". In in a windows environment. – Giovanni Bruner Jun 17 '16 at 10:07
  • You have to have installed the software you references in `filter`. Most UNIX systems will have `gawk`, `awk` or some variation already or else you can install it yourself and Rtools ( https://cran.r-project.org/bin/windows/Rtools/ ) has `gawk` on Windows. – G. Grothendieck Jun 17 '16 at 10:58

0 Answers0