downloading data with webread

14 ビュー (過去 30 日間)
Nicola Borri
Nicola Borri 2018 年 7 月 17 日
回答済み: Rik 2018 年 7 月 17 日
I would like to download on a local folder files with extension .txt.gz. I tried using webread with options weboptions('KeyName','Accept-Encoding','KeyValue','gzip'), but I cannot understand how to simply save the file in .txt format. Any suggestions?
  2 件のコメント
Rik
Rik 2018 年 7 月 17 日
Do you want to save a file as .txt.gz or as .txt? Would a simple renaming be what you want, or should a .txt be extracted from the .gz?
Nicola Borri
Nicola Borri 2018 年 7 月 17 日
I would like to have in my local folder the .txt file

サインインしてコメントする。

採用された回答

Rik
Rik 2018 年 7 月 17 日
You can use gunzip:
url = 'http://example.com/example.txt.gz';
gunzip(url);
If you can't download the file with that, you'll need websave as an intermediary:
url = 'http://example.com/example.txt.gz';
file = websave('example.txt.gz',url);
gunzip(file);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWeb Services についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by