このようなエラーで次のコードを実行しています。
> 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 に置き換えたりすることはできません。