> > You can use a system call to execute a command like the following; > > > > sqlite3 -separator , test.db ".import test.csv sometable" > > > > That is exactly what I needed! Thanks a ton. > > Joe Noon >
My issue now is that the csv may or may not have all of the columns that my table has. For instance, my table has 12 columns, but the csv has only 2 or 3 columns worth of data in some instances. This is possibly due to a mal-formatted csv to begin with, but its all I have to work with here. sqlite obviouslly errors out saying the file only has x records but the table contains 12. Is there any way to force the import no matter what exists? For some background on what Im trying to do.. basically Im just trying to get a csv file into the db so i can use SQL to search by the first column. The column names are just a,b,c etc. Data integrity is a non-issue here.