我正在运行以下代码并出现此类错误。
> rat <- scan("sortedratings.csv",nlines=760,sep=",",what=rat.cols,multi.line=FALSE);
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
line 755 did not have 8 elements
>
这是造成所有麻烦的线路
ubuntu@ip-10-28-6-239:/data/csv$ sed -n "750,760p" sortedratings.csv
"281656475","2.5.0","Jul 17, 2011","","","KK9876",4,0
"281656475","2.5.0","Jul 17, 2011","","","Lyteskin45",4,0
"281656475","2.5.0","Jul 17, 2011","","","Mrs. Felton",5,0
"281656475","2.5.0","Jul 17, 2011","","","Nick Bartoszek",4,0
"281656475","2.5.0","Jul 17,2011","","","SANFRANPSYCHO",5,0
"281656475","2.5.0","Jul 17, 2011","","","Wxcgfduytrewjgf@!?$(:@&&$&@\"",5,0
"281656475","2.5.0","Jul 18, 2011","","","Downs58",5,0
"281656475","2.5.0","Jul 18, 2011","","","kitty1019",5,0
"281656475","2.5.0","Jul 18, 2011","","","Rj&e",4,0
"281656475","2.5.0","Jul 18, 2011","","","Robin Kinzer",5,0
"281656475","2.5.0","Jul 18, 2011","","","Roderick Palmer",5,0
ubuntu@ip-10-28-6-239:/data/csv$ s
我尝试了不同的修复方法,但我无法找出正确的修复方法。任何的想法?
对于没有文本或任何内容,我没有问题删除反斜杠。
哦,忘了补充,文件有 1.4GB 大,所以我无法读取所有文件,或者只是用 sed 替换它,因为它对我的系统来说太大了。