-->

Error : SQLite import data from file

2019-02-24 23:44发布

问题:

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

回答1:

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

Try

sqlite> .import /home/.../db-positiveTweets feature_category