I suggest that the prospect of loading an entire (9GB) file into R for the sole purpose of ingesting into a SQLite3 database is a little flawed (you may not have sufficient memory to load into R). Instead, use sqlite3
by itself.
I have pre-made a file mt.csv
from mtcars
.
$ sqlite3 -csv mt.sqlite3 '.import mt.csv mtcars'
$ ls -l mt.sqlite3
-rw-r--r-- 1 r2 r2 8192 Feb 4 12:19 mt.sqlite3
$ sqlite3 -column -header mt.sqlite3 'select * from mtcars limit 3'
mpg cyl disp hp drat wt qsec vs am gear carb
---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
21 6 160 110 3.9 2.62 16.46 0 1 4 4
21 6 160 110 3.9 2.875 17.02 0 1 4 4
22.8 4 108 93 3.85 2.32 18.61 1 1 4 1
The sqlite3
binary is not installed by default on many (any?) systems, but it is an easy and free download/installation (see https://www.sqlite.org/download.html).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…