Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error : SQLite import data from file

Tags:

import

sqlite

csv

I am trying to load data from a file which is comma-separated. example:

A,positive,9619
A095CDB461A1FEED,positive,1  

When I am trying to load this file in sqlite3 database I am getting error:

sqlite> .mode csv feature_category
sqlite> .import /home/harit/work/python/what-twitter-speaks/classifier/data/snap_data_collection/db-positiveTweets feature_category;
Error: no such table: feature_category;

Though the table already exists.

sqlite> select * from sqlite_master;
table|feature_category|feature_category|2|CREATE TABLE feature_category(feature, category, count)
table|categorycount|categorycount|3|CREATE TABLE categorycount(category, count)  

Please help, I am new to sqlite3

Thank you

like image 342
daydreamer Avatar asked Mar 15 '26 06:03

daydreamer


1 Answers

It seems that the problem is the semicolon ; at end of the command.

Try

sqlite> .import /home/.../db-positiveTweets feature_category
like image 59
Nick Dandoulakis Avatar answered Mar 19 '26 00:03

Nick Dandoulakis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!