读书人

sqlite3中怎么导入数据

发布时间: 2012-02-28 13:06:35 作者: rapoo

sqlite3中如何导入数据
在linux系统下
sqlite3 dbname "sql" > 1.txt
这样,可以将查询的内容导入到1.txt

现在我想将1.txt导入到另一个db的表里,表结构与导出的一致。
请问一下,如何操作??谢谢。

[解决办法]
sqlite> .import 1.txt tt
[解决办法]

引用For simple CSV files, you can use the SQLite shell to import the file into your SQLite database. First create the table, then designate the separator, and finally import the file.


sqlite> create table test (id integer, datatype_id integer, level integer, meaning text);
sqlite> .separator ","
sqlite> .import no_yes.csv test
Unfortunately, not all CSV files are simple. For instance, the CSV line


"Last, First", 1234

读书人网 >其他数据库

热点推荐