Invalid field count in CSV input on line 1(第 1 行的 CSV 输入中的字段计数无效)
问题描述
我正在尝试将 ODS 文件导出到 CSV,但是当我导入到 phpmyadmin 时 - 我收到第 1 行的 CSV 输入中的字段计数无效".
I am trying to export an ODS file to CSV, but when I import into phpmyadmin - I get "Invalid field count in CSV input on line 1."
文件(它有两行以上,但方案是一样的):
File (it has more than two lines but the scheme is the same):
"Administração da Guarda Nacional Republicana"
"Administração de Publicidade e Marketing"
表格:
CREATE TABLE IF NOT EXISTS `profession` (
`id_profession` int(11) NOT NULL,
`profession` varchar(45) DEFAULT NULL,
`formation_area_id_formation_area` int(11) NOT NULL,
PRIMARY KEY (`id_profession`),
UNIQUE KEY `profession_UNIQUE` (`profession`),
KEY `fk_profession_formation_area1` (`formation_area_id_formation_area`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
我从不做类似的事情,可能我需要指定列.csv 只有一列,表格有三列.在这种情况下,文件输入属于职业列
I never do something similar, probably i need to specify the columns. the csv only have one column and the table have three. In this case the file input belongs to profession column
推荐答案
如果您希望将其导入该表,您有 2 个选择:
If you want this to import into that table you have 2 choices:
1) 在文件每一行的数据前后添加逗号,或
1) Add a comma before and after the data in every row of your file, or
2) 删除表中的第一列和第三列,导入数据,然后将删除的两列添加回来.
2) Delete the first and third columns in your table, import the data and then add the 2 columns you deleted back.
这篇关于第 1 行的 CSV 输入中的字段计数无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:第 1 行的 CSV 输入中的字段计数无效
基础教程推荐
- 从字符串 TSQL 中获取数字 2021-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 带更新的 sqlite CTE 2022-01-01
