我可以将excel文件导入phpmyadmin吗?

发布于 2024-09-01 03:33:42 字数 80 浏览 4 评论 0原文

我有一个电子表格文件,其中包含一些数据,例如 ID、姓名、姓氏。我可以将 Excel 文件导入 phpmyadmin (SQL) 吗? 怎么做呢?

I have an speadsheet file contains some data such as ID, name, lastname. Can I import excel file to phpmyadmin (SQL)?
How to do it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

总攻大人 2024-09-08 03:33:42

首先将电子表格导出为 CSV,然后导入为 CSV。

Export the spreadsheet as CSV first, then import as CSV.

已下线请稍等 2024-09-08 03:33:42

Excel 表格不得包含空白单元格 - 当创建 CSV 文件时,行中字段数错误时,这些单元格将被跳过担心的。此外,Excel 单元格不得包含任何用作分隔符的符号(通常为双引号" 和逗号,。分隔符可能会根据 Excel 版本/语言的不同而有所不同Excel

2016 CSV 看起来像:

22,Fred,Bloggs,22,Acacia Avenue 

...但是 phpMyAdmin 要求:

"22","Fred","Bloggs","22","Acacia Avenue"

我的提示 - 在 Excel 表格之前和之后添加额外的列并填充每个列包含诸如 ZZ 之类的独特内容的列,然后使用带有查找/替换的文本编辑器将每个逗号更改为 ", "。这将为您提供 ZZ","22","Fred","Bloggs","22","Acacia Avenue","ZZ。然后查找/替换 ZZ","",然后 ","ZZ"

现在是您的 CSV 。符合 phpMyAdmin 的需要。

Excel tables must not have blank cells - these will be skipped when CSV file is created giving the wrong number of fields in the row(s) concerned. Also Excel cells must not contain any symbols used as delimiters (typically doublequote" and comma,. The delimiters may vary according to excel version/language.

Excel 2016 CSV looks like:

22,Fred,Bloggs,22,Acacia Avenue 

...but phpMyAdmin requires:

"22","Fred","Bloggs","22","Acacia Avenue"

My tip - add extra columns before and after your excel table and fill each column with something unique like ZZ. Then create CSV. Use a text editor with Find/Replace to change each comma to ",". This gives you ZZ","22","Fred","Bloggs","22","Acacia Avenue","ZZ. Then Find/Replace ZZ"," with " and then ","ZZ with ".

Now your CSV matches what phpMyAdmin needs.

梦中楼上月下 2024-09-08 03:33:42

您认为可能是空的 Excel 字段中是否有空格?您还想检查文本字段中是否未显示分隔符。这意味着,如果您用逗号存储了一个人的姓名或 ID,例如“Nixon,Richard”,它会认为这是两个单独的列,从而使您在使用第一个删除行作为超过 2 列时出现计数不匹配。

该错误消息告诉您,与数据行相比,它发现了不同数量的列。您的分隔符很可能位于数据单元内部。

is there a white space in what you think could be an empty excel field? Also you want to check that your delimiter isnt represented in the text field. Meaning that if you have stored a persons name or id with a comma, like "Nixon, Richard", it will think that is for two seperate colums, giving you a count mismatch on using the first delemited lines as more than 2 colums.

The error message is telling you that it found a different number of columns when compared to the rows of data. More than likely your delimiter is inside of your datacells.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文