3

I export the data from Excel 2011. The rows look like:

100|Agricultural Production-Crops|Agriculture&Forestry

I create the table in SQLite using: create table sic (id integer, industry text, category text); Then I input:

.mode csv sic

then:

.separator ","

then:

.import SIC.csv sic;

And I got the error: "Error: no such table: sic;" Why? What can I do?

1

2 Answers 2

1

The last parameter is the table name and should be sic in your case:

.import SIC sic;

The first parameter is the filename and should usually end in ".csv" or ".txt" for example (but it doesn't have to). You may want to double check that your filename is correct.

See the documentation:

.import FILE TABLE - Import data from FILE into TABLE

Sign up to request clarification or add additional context in comments.

Comments

0

I find out from here: http://old.nabble.com/Import-CSV-in-sqlite3--td564241.html.

Exit SQlite 3. And key in:

sqlite3 -separator ',' test.db ".import sic.csv sic"

This solve the problem.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.