【问题标题】:How to unzip a unknown zip file in the google colab如何在 google colab 中解压缩未知的 zip 文件
【发布时间】:2022-08-19 02:57:53
【问题描述】:

我从 google colab 下载了一个数据集。但它既不是文件夹也不是 zip 文件。它没有关于它的扩展。我使用!wget https://sc.link/r7wp 命令下载了它。但是我无论如何都无法解压缩或提取它。谁能帮我提取这个?有关更多说明,请参见给定的屏幕截图

截屏

标签: google-colaboratory extract unzip


【解决方案1】:

我们来看一下

首先尝试下载它

$ wget  https://sc.link/r7w
--2022-08-12 11:59:49--  https://sc.link/r7w
Resolving sc.link (sc.link)... 37.230.233.245
Connecting to sc.link (sc.link)|37.230.233.245|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://sc.link/ [following]
--2022-08-12 11:59:58--  https://sc.link/
Reusing existing connection to sc.link:443.
HTTP request sent, awaiting response... 200 OK
Length: 30986 (30K) [text/html]
Saving to: ‘r7w’

r7w                           100%[=================================================>]  30.26K  --.-KB/s    in 0s

2022-08-12 11:59:58 (97.0 MB/s) - ‘r7w’ saved [30986/30986]

解压是怎么想的

$ unzip -l r7w
Archive:  r7w
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
note:  r7w may be a plain executable, not an archive
unzip:  cannot find zipfile directory in one of r7w or
        r7w.zip, and cannot find r7w.ZIP, period.

这与您所看到的相符。让我们看看它是否真的是一个 zip 文件。

$ file r7w
r7w: HTML document, UTF-8 Unicode text, with very long lines

不 - 不是 zip 文件。它是 HTML

$ head r7w
<!DOCTYPE html><html lang="ru"><head><meta name="viewport" content="width=device-width, initial-scale=1"/><meta name="developers" content="Shadow Dev Team: Kirill Shekhovtsov, Nickolay Galko, Daniil Shemelin, Ivan Ganev, Anatoly Lukasevich, Vlad Vihrov, Alexander Sudarev, Grigory Bezobrazov"/><meta name="theme-color" content="#333333"/><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="SberCloud - облачная платформа Группы Сбербанк"/><meta property="og:image" content="https://sc.link/sc-link-og.png"/><meta name="yandex-verification" content="0ee928565a89abce"/><meta name="facebook-domain-verification" content="q27f48up1g7ono6azi8oe82uwrrysr"/><meta name="google-site-verification" content="6Jsi0B7XAEVcTZTNbbcRG__GhyFIaI-Oej8AiqNMqAg"/><link rel="icon" type="image/png" href="/favicon.png"/><link rel="apple-touch-icon" href="https://sc.link/logo-192.png"/><link rel="shortcut icon" href="/favicon.png"/><link rel="manifest" href="/manifest.json"/><script>(function (w, d, s, l, i) {

【讨论】:

  • 我只是使用命令来提取它:!jar xvf r7wp
【解决方案2】:

我使用这个命令解决了这个问题。

!jar xvf r7wp

其中r7wp 是文件名

【讨论】:

    猜你喜欢
    • 2020-11-05
    • 2018-11-08
    • 2021-12-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-26
    相关资源
    最近更新 更多