经过大量的搜索和试验,我根本无法理解。我有一个csv,其字段都在引号内,无法导入。我的基本脚本如下。如果没有引号,它可以正常工作。我希望它只打印出前三行。我认为这可能是我需要添加的过滤器参数?
library(sqldf)
sqldf("attach testingdb as new")
read.csv.sql("df.csv", sql = "create table main as select * from file", dbname = "testingdb")
sqldf("select * from main limit 3", dbname = "testingdb")
这是csv的两行内容:
“ {6DA08449}”,“ 89000”,“ 2002-05-10 00:00”,“ MK42Q”,“ S”,“ N”,“ F”,“ 38”,“” “ {6DB08449}”,“ 100000”,“ 2002-05-10 00:00”,“ M429HQ”,“ S”,“ N”,“ F”,“ 38”,“”