How to download a file from NOAA server?

조회 수: 7 (최근 30일)
jcjaimes
jcjaimes 2015년 9월 8일
댓글: jcjaimes 2015년 9월 8일
I tried to download a text file from NOAA server using this code:
clear
mw = ftp('ftp.ncdc.noaa.gov');
dir(mw)
mget(mw, 'ghcnd-stations.txt');
end
After taking a while to run it, I got the next error: Error using ftp/mget (line 106) File "ghcnd-stations.txt" not found on server.
Then, I modified the last line with:
mget(mw, 'ghcnd-stations.txt', 'pub/data/ghcn/daily');
and later with:
mget(mw, 'pub/data/ghcn/daily', 'ghcnd-stations.txt');
But, there is still an error.
Any guidance is appreciated.

채택된 답변

Walter Roberson
Walter Roberson 2015년 9월 8일
mw = ftp('ftp.ncdc.noaa.gov');
cd(mw, 'pub/data/ghcn/daily');
files_stored_as = mget(mw, 'ghcnd-stations.txt');
Now you can process the downloaded file, whose full stored location is in files_stored_as{1}

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Downloads에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by