发布网友
共2个回答
懂视网
*.sql文件导入数据库通常比较方便。
其他格式如csv、xsl等文件导入比较费劲。
推荐一个针对csvxsl的导入工具:https://github.com/zhengze/file_to_db.git
具体用法请看README:
load data from csv/xlsx into database(mysql/postgresql)
pipenv install #或者
pip install -r requirements.txt
DATABASE_URI=postgresql+psycopg2://admin:1234@localhost/test
python file_to_db.py -h
usage: file_to_db.py [-h] [--file FILE] [--table TABLE]
optional arguments:
-h, --help show this help message and exit
--file FILE, -f FILE the file path.
--table TABLE, -t TABLE
the table name.
文件(csv/xslx)中的数据导入到数据库中
标签:sql 格式 targe ble load pytho local 推荐 name
热心网友
导入方法有多种,csv文件可以通过PLSQL/DEVELOPER的文本导入器导入(工具-文本导入器),也可将其转成xls通过ODBC导入器导入(工具-ODBC导入器),也可借助第三方工具导入,也可通过宿主语言(C#、JAVA等)导入,也可利用外部工具将其转化为insert语句导入……