websave adds html to file name
조회 수: 10 (최근 30일)
이전 댓글 표시
Any reason why 'websave' adds a '.html' to the name of the output file?
I'm downloading coronavirus data from John Hopkins University github. I use websave as recomended. No matter what I do, the saved file has a '.html' added after the '.csv'. My code is as follows:
url= 'https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_time_series/';
fileinf= 'time_series_covid19_confirmed_global.csv';
websave(fileinf,url);
The file that is saved has name:
time_series_covid19_confirmed_global.csv.html
Any solutions?
Thanks
댓글 수: 0
채택된 답변
Ameer Hamza
2020년 5월 15일
편집: Ameer Hamza
2020년 5월 15일
Because URL you mentioned corresponds to a webpage, not a CSV file.
Try the following code.
url = 'https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv';
fileinf= 'time_series_covid19_confirmed_global.csv';
websave(fileinf,url);
댓글 수: 0
추가 답변 (1개)
smith lili
2020년 9월 22일
The reason is that: In the websave function file, the URL whoe extension is not "html" is taken as "The filename does not have an extension", so "html" will be added. If changing "||" in Line 124 in websave file to "&&", "html" will be not added any more.
참고 항목
카테고리
Help Center 및 File Exchange에서 Biological and Health Sciences에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!