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!