导入数据时遇到错误字符(ASCII 0)

use*_*990 1 google-bigquery

我试图导入一些数据并收到错误"遇到错误字符(ASCII 0)"

我正在尝试导入的文件位于 http://commondatastorage.googleapis.com/snksales/dimdistributor.csv

无法理解如何解决这个问题.

谢谢,

Jor*_*ani 7

此文件似乎编码为UTF-16.BigQuery仅支持UTF-8和latin1文本编码.你能把它重新格式化为UTF-8或ascii吗?如果您使用的是Windows,则应该可以通过执行保存来设置编码 - 就像在记事本中一样.如果你使用的是linux或mac,你应该可以:iconv -f utf-16 -t utf-8 dimdistributor.csv -o dimdistributor_utf8.csv.我运行后者并能够导入您的数据.

$ xxd dimdistributor.csv | 头0000000:fffe 3100 2c00 3000 3000 3000 3000 3100 ..1.,.0.0.0.0.1.0000010:3000 3000 3000 3000 3200 2c00 4d00 2e00 0.0.0.0.2.,.M ... 0000020:4d00 2e00 4500 4e00 5400 4500 5200 5000 M ... ENTERP 0000030:5200 4900 5300 4500 5300 2c00 3200 0d00 RISES,. 2 ... 0000040:0a00 3200 2c00 3000 3000 3000 3000 3100 ..2.,.0.0.0.0.1.