downloading data with webread
14 次查看(过去 30 天)
显示 更早的评论
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
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?
采纳的回答
Rik
2018-7-17
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Web Services 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!