Bulk load data into sqlite?

前端 未结 2 659
攒了一身酷
攒了一身酷 2020-12-02 13:11

Does anybody have any tips on utilities that can be used to bulk load data that is stored in delimited text files into an SQLite database?

Ideally something that can

相关标签:
2条回答
  • 2020-12-02 13:52

    Why do you want a text file?

    Just use Java which does have easily available libraries for Oracle and SQLite access. Connect to both databases and just select from one db and insert into another with no additional complexity of CSV, which is not a very well defined format and will give you problems with character encoding, quotes, comas/tabs or semicolons, newlines etc. in your data.

    0 讨论(0)
  • 2020-12-02 13:58

    Check out the sqite .import command - it does exacty this.
    You can set the separator with the .separator command

    sqlite3 myDatabase
    create table myTable (a, b, c);
    .separator ','
    .import  myFile  myTable
    
    0 讨论(0)
提交回复
热议问题