Estou usando o Ubuntu e o que baixei este arquivo CSV , que file
me diz como:
ASCII text, with very long lines, with CRLF line terminators
No entanto, quando passo csvcut -e ASCII datafile
, obtenho:
Your file is not "utf-8" encoded. Please specify the correct encoding with the -e flag. Use the -v flag to see the complete error.
e quando eu passar csvcut -e ASCII datafile
, obtenho:
Your file is not "ASCII" encoded. Please specify the correct encoding with the -e flag.
(nem o uso de letras maiúsculas nem a cópia e colagem do resultado exato em file
melhoram isso.)
O erro completo ( -v
) se parece com isto:
Traceback (most recent call last):
File "/usr/local/bin/csvcut", line 9, in <module>
load_entry_point('csvkit==0.9.2', 'console_scripts', 'csvcut')()
File "/usr/local/lib/python2.7/dist-packages/csvkit-0.9.2-py2.7.egg/csvkit/utilities/csvcut.py", line 64, in launch_new_instance
utility.main()
File "/usr/local/lib/python2.7/dist-packages/csvkit-0.9.2-py2.7.egg/csvkit/utilities/csvcut.py", line 53, in main
for row in rows:
File "/usr/local/lib/python2.7/dist-packages/csvkit-0.9.2-py2.7.egg/csvkit/unicsv.py", line 51, in next
row = next(self.reader)
File "/usr/local/lib/python2.7/dist-packages/six.py", line 535, in next
return type(self).__next__(self)
File "/usr/local/lib/python2.7/dist-packages/csvkit-0.9.2-py2.7.egg/csvkit/unicsv.py", line 35, in __next__
return next(self.reader).encode('utf-8')
File "/usr/lib/python2.7/codecs.py", line 615, in next
line = self.readline()
File "/usr/lib/python2.7/codecs.py", line 530, in readline
data = self.read(readsize, firstline=True)
File "/usr/lib/python2.7/codecs.py", line 477, in read
newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)