简体   繁体   English

如何将Excel工作表中的数据添加/添加到表中?

[英]How do I add/append data from an excel sheet to a table?

The Excel sheet is huge; Excel工作表很大; contains around 40,000 rows. 包含约40,000行。 Both the table and the excel sheet have an equal number of columns. 表和Excel工作表都具有相等的列数。 I am using Ubuntu Linux, Libre Office and MySQL workbench. 我正在使用Ubuntu Linux,Libre Office和MySQL工作台。 All I could find when I searched on the web was to import using MySQL Server Studio(I don't think it is available for Ubuntu), and queries containing "Microsoft.Jet-OPENROWSET" query. 我在网上搜索时所能找到的就是使用MySQL Server Studio导入(我认为Ubuntu不可用)以及包含“ Microsoft.Jet-OPENROWSET”查询的查询。 I am new to performing tasks other than the basic operations in excel/SQL. 我不擅长执行Excel / SQL中的基本操作以外的任务。

And also, what format should the excel be in? 而且,excel应该采用哪种格式? Should it contain the column names explicitly? 它应该明确包含列名吗?

Is there a simple way to perform this operation? 有一种简单的方法可以执行此操作吗?

Thank You in Advance. 先感谢您。

You can use the following: 您可以使用以下内容:

LOAD DATA LOCAL INFILE '/path/to/your/file'  INTO TABLE tablename
FIELDS TERMINATED BY ',' lines terminated by '\n';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM