将 Excel 工作表导入 phpMyAdmin [英] Importing Excel sheet into phpMyAdmin

查看:38
本文介绍了将 Excel 工作表导入 phpMyAdmin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用 phpMyAdmin,但遇到了一个问题.将我的 CSV 导入 phpMyAdmin 时,它会将数字四舍五入.我已将列设置为浮点数,将 Excel 中的列设置为数字(也尝试过文本/常规),但无济于事.有没有其他人遇到过这个问题并找到了可行的解决方法?

I'm currently playing around with phpMyAdmin and I have encountered a problem. When importing my CSV into phpMyAdmin it's rounding the numbers. I have set the column to be a float and the column in Excel to be a Number (Also tried text/General) to no avail. Has anyone else encountered this issue and found a viable work-around?

第二个问题,我是否可以上传 CSV 文件,以便将 phpMyAdmin 中的列名与 Excel 列名相匹配并在正确的列中输入数据?

A second question, is it possible for me to upload the CSV file so that it matches the column names in phpMyAdmin to Excel column names and enters the data in the correct column?

推荐答案

  1. 您的文件应如下所示(十进制字段为一般类型):

xlssheet

  1. 另存为 CSV.文件可能会保存为 ;分开

这是用于新表:

  1. 打开phpMyAdmin,选择你的数据库,点击导入并选择要上传的文件
  2. 如果没有选择,则将格式更改为 CSV
  3. 更改格式特定选项 - 列分隔:;
  4. 确保复选框(文件的第一行包含表列名(如果取消选中,第一行将成为数据的一部分))是 SELECTED
  5. 点击开始
  6. 将根据 CSV 中的 forst 行使用结构创建新表.

这是针对现有表格的:

  1. 打开phpMyAdmin,选择你的数据库,选择你的表格,与导入文件的结构匹配,点击导入并选择要上传的文件
  2. 如果没有选择,则将格式更改为 CSV
  3. 更改格式特定选项 - 列分隔:;
  4. 将跳过查询次数更改为 1(这将跳过带有列名的第一行)
  5. 点击开始
  6. 与 CSV 具有相同结构的选定表将被更新并插入 CSV 中的行.
  1. Open phpMyAdmin, choose your database, CHOOSE YOUR TABLE which match the structure of imported file, click to import and select file to upload
  2. Change format to CSV if there is not selected
  3. Change in format specific options - columns separated with: ;
  4. Change skip number of queries to 1 (this will skip the first line with column names)
  5. Click Go
  6. Selected table wich has the same structure as CSV will be updated and rows in CSV inserted.

这篇关于将 Excel 工作表导入 phpMyAdmin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆