Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save ppflrs/77965b375cad737d238e7667f5c3c609 to your computer and use it in GitHub Desktop.
Save ppflrs/77965b375cad737d238e7667f5c3c609 to your computer and use it in GitHub Desktop.
Convert "application/octet-stream; charset=binary" to ASCII
@S767
Copy link

S767 commented Sep 11, 2017

awesome. it's works

@sajjadintel
Copy link

woo thanks

@wmmxk
Copy link

wmmxk commented Apr 6, 2019

Awesome. It works. I downloaded a csv file from a database and I got all NA when I read it to python using pandas.read_csv function.

After I check the datatype of the file using this command: file -i , and found it is charset=binary but not ascii.

@wmmxk
Copy link

wmmxk commented Apr 6, 2019

It turned out this command fails at some files. Do you have ideas about why it works on some files and fails at others?

@hheisego
Copy link

thanks man, is working for me... just stills giving some trash the output but almost all i need is there

@cloudwithankit
Copy link

i tried above and then ran $ file -bi file.out , still see "application/octet-stream; charset=binary" , please help

@RPGillespie6
Copy link

Doesn't work for me: tr -d \0 : command not found

@robintux
Copy link

I am trying to load some files from (on ubuntu20.04)

Data completa de la Encuesta Nacional Demografía y Salud Familiar (ENDES) 2019 - [Instituto Nacional de Estadística e Informática - INEI]

promptly : 2019/691-Modulo64/Modulo64/RECH0.csv

But in python (pandas module) i have an error :

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf0 in position 442: invalid continuation byte

Please, any ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment