错误:SQLite从文件导入数据 [英] Error : SQLite import data from file

查看:184
本文介绍了错误:SQLite从文件导入数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试从逗号分隔的文件加载数据。示例:

  A,正数,9619 
A095CDB461A1FEED,正数,1



当我试图在sqlite3数据库中加载此文件时,我收到错误:

  sqlite> .mode csv feature_category 
sqlite> .import / home / harit / work / python / what-twitter-speaks / classifier / data / snap_data_collection / db-positiveTweets feature_category;
错误:没有这样的表:feature_category;

虽然表已经存在。

  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)

请帮助,我是新的sqlite3



谢谢

解决方案

似乎问题是命令末尾的分号;



尝试

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


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

解决方案

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

Try

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

这篇关于错误:SQLite从文件导入数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆