downloading data with webread
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Rik
am 17 Jul. 2018
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?
Akzeptierte Antwort
Rik
am 17 Jul. 2018
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Web Services finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!