更新时间:2023-01-30 21:11:50
如果CSV文件中的列未映射到SQLite表中的列,则需要首先进行一些数据转换,即减少列数表中的列数,并相应地命名. 然后,您可以使用内置的CSV导入程序来导入数据.
If the columns in your CSV file don't map into the columns in your SQLite table then you need to do some data transformation first i.e. reduce the number of columns to the number of columns in your table, and name them accordingly. Then you can use the built-in CSV importer to import the data.
将模式设置为csv
Set mode to csv
sqlite> .mode csv
使用以下命令从csv文件导入数据:
Import the data from your csv file with the following command:
sqlite> .import c:/path/to/your/file/use/forward/slashes destination_table_name
这是一个非常好的教程. http://www.sqlitetutorial.net/sqlite-import-csv/
This is a really good tutorial. http://www.sqlitetutorial.net/sqlite-import-csv/