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
means two columns in Excel (a name and an integer), but three columns with embedded quote marks in SQLite. Be wary when trying to import CSV files.
2010년 6월 18일 금요일
피드 구독하기:
덧글 (Atom)
