0

Consider this page: url=site="https://www.gov.br/infraestrutura/pt-br/assuntos/transito/arquivos-denatran/estatisticas/renavam/2021/janeiro/i_frota_por_uf_municipio_marca_e_modelo_ano_janeiro_2021.zip"

How do I save the file inside that zip (it is in txt), separating it by ",", inside a directory (path)? I don't want to save the .zip file, just the file inside it. Please help me.

  • 1
    You have to download it (zip) first and then unpack the text file. There is no way to do it "online", even knowing this text file name and path inside archive. – tansy Apr 01 '21 at 22:58
  • But, I don't want to do anything online. I want to save to disk. Please teach me how to make Python save this file in TXT. I can't do that. I can only download the zipped folder and save this zip. But, I can't get python to read this txt file. – Luciana Diogenes Apr 01 '21 at 23:24
  • I will try. Thank you. – Luciana Diogenes Apr 02 '21 at 00:55
  • Just download archive, open with any archive (like winrar, 7zip, winzip) or file manager (double commander, far manager, total commander, anything like that), browse to the given file and unpack. – tansy Apr 02 '21 at 04:00
  • If you want command line solution then: `wget http://example.org/archive.zip` `unzip archive.zip path/to/file/in/archive/document.txt`. – tansy Apr 02 '21 at 04:08
  • Thanks, tansy. I managed to do what I wanted. It worked. – Luciana Diogenes Apr 02 '21 at 22:52

0 Answers0