Error: SQLite imports data from a file

I am trying to load data from a comma separated file. Example:

A,positive,9619 A095CDB461A1FEED,positive,1 

When I try to upload this file to sqlite3 database, I get an error message:

 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; 

Although 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'm new to sqlite3

thanks

+3
source share
1 answer

The problem seems to be the semicolon ; at the end of the team.

Try

 sqlite> .import /home/.../db-positiveTweets feature_category 
+4
source

Source: https://habr.com/ru/post/896137/


All Articles