I woud like to transform a very big csv
file into a sqlite
file. I see that I can do it via dbWriteTable
from RSQLite
R package. However, I would like to select a specific subset of columns I am interested to, in order to decrease memory space and future computational time. Does somebody knows how to do it? Thanks.
Asked
Active
Viewed 182 times
0

damianooldoni
- 475
- 5
- 6
-
1Is there any reason why you can't/don't want to just import the CSV file directly into SQLite? There are a number of ways to do this. – Tim Biegeleisen Mar 05 '19 at 10:23
-
Why you just select the columns you want to transform by using `filter` o the equivalent `data.frame` or `data.table` sintax? You can even just read your desired columns to save from `csv`: https://stackoverflow.com/questions/54611277/read-csv-in-r-and-filter-columns-by-name/54611305#54611305 – LocoGris Mar 05 '19 at 10:25
-
I can import the all CSV file and then remove columns I don't need, but I was wondering why don't do it immediately just by not selecting them. – damianooldoni Mar 05 '19 at 10:30
-
Then look at https://stackoverflow.com/questions/54611277/read-csv-in-r-and-filter-columns-by-name/54611305#54611305 – LocoGris Mar 05 '19 at 10:45