Re: [sqlite] loading data from file with the file name as the extra field

2010-07-02 Thread Jim Morris
Try creating a script file something like(Psuedo code): .separator "," CREATE TEMP TABLE dummy (value); .import file1.csv dummy INSERT INTO TEST (filename,number) (SELECT 'file1.csv', value FROM dummy; delete from dummy; .import file2.csv dummy INSERT INTO TEST (filename,number) (SELECT 'file2.csv'

[sqlite] loading data from file with the file name as the extra field

2010-07-02 Thread Peng Yu
Hi, Suppose that I have a number of files, each file has some numbers in it (by line). I want to load the content of each file and the associated filename into the following table. create table test (id integer primary key, filename text, number integer); For example, if file 'a' has number 1,2