Martin Jenkins wrote:
RohitPatel9999 wrote:
/* SQLite 3.3.8 (Windows) used */
/* table t1 */
/* only two columns are given because other columns are irrelevant
here */
create table t1 (id INTEGER PRIMARY KEY, name TEXT);
/* few sample records from csv file data.csv */
1,'name_text_1'
2,'name_text_2'
3,'name_text_3'
4,'name_text_4'
/* import statement */
.import imp3.csv t1
If your CSV files' id columns are unwanted you could delete them rather
than edit them. Writing a simple script to clean up your data would be
trivial on 'nix but I see you're on Windows so how about something like:
create table t1 (id INTEGER PRIMARY KEY, name TEXT);
alternatively
create table t1 (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT);
if "id" is not important as long as it is unique.
create table t1raw (id INTEGER, name TEXT);
.import imp3.csv t1raw
insert into t1(name) select name from t1raw;
drop table t1raw;
Martin
--
Regards
John McMahon
[EMAIL PROTECTED]
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------