读取CSV错误:非法数据.什么'正在发生

reading CSV error: Illegal Data. What's happening?

本文关键字:什么 错误 CSV 非法 数据 读取      更新时间:2023-09-26

我有以下错误,我不知道发生了什么…

这是我的csv文件中的第一行(我使用vim打开它)

longitude,latitude,ph,ammonium_nitrate,phosphate,permanganate,heavy_metal,email_address^M

这是我在safari控制台中看到的错误:

[Error] Error: CSVDataError: Illegal Data [Row:1][Col:8]
(anonymous function) (jquery-csv-0.71.js, line 253)
replace
parse (jquery-csv-0.71.js, line 160)
toArrays (jquery-csv-0.71.js, line 664)
success (demo.html, line 64)
c (jquery-1.10.2.min.js, line 4)
fireWith (jquery-1.10.2.min.js, line 4)
k (jquery-1.10.2.min.js, line 6)
r (jquery-1.10.2.min.js, line 6)

任何建议都将不胜感激!!非常感谢!

文件似乎是从窗口框中导入的(由于存在^M字符)。如果你在linux中处理这个文件,你的解析器可能不喜欢它。从你的文件中删除^M。