Download a file from a website?

26 ビュー (過去 30 日間)
Ara
Ara 2022 年 8 月 6 日
編集済み: Ara 2022 年 8 月 12 日
Dear All,
I have a code to download data from a website. It downolad it but the folder is empty inside init. Do you know where the problem is?

採用された回答

Walter Roberson
Walter Roberson 2022 年 8 月 6 日
編集済み: Walter Roberson 2022 年 8 月 6 日
  22 件のコメント
Walter Roberson
Walter Roberson 2022 年 8 月 11 日
I tested the code on my system (Mac). For example,
>> ls /private/var/folders/jq/wx1hzy713dj_408tpm5fck040000gn/T/cosmic2013/001/cosmic2013/scnLv1/2013.001/
scnLv1_C001.2013.001.00.00.0004.G08.03_2013.3520_nc scnLv1_C002.2013.001.02.02.0033.G14.01_2013.3520_nc scnLv1_C002.2013.001.18.53.0027.G16.01_2013.3520_nc scnLv1_C005.2013.001.08.12.0008.G10.01_2013.3520_nc
scnLv1_C001.2013.001.00.01.0001.G22.02_2013.3520_nc scnLv1_C002.2013.001.02.03.0001.G20.02_2013.3520_nc scnLv1_C002.2013.001.18.54.0001.G05.02_2013.3520_nc scnLv1_C005.2013.001.08.18.0001.G04.02_2013.3520_nc
scnLv1_C001.2013.001.00.02.0001.G31.02_2013.3520_nc scnLv1_C002.2013.001.02.04.0019.G02.01_2013.3520_nc scnLv1_C002.2013.001.18.54.0023.G19.01_2013.3520_nc scnLv1_C005.2013.001.08.18.0001.G28.03_2013.3520_nc
(and more)
I did not test it on Windows (I am not sure I have a functioning Windows MATLAB installed at the moment.)
Ara
Ara 2022 年 8 月 11 日
編集済み: Ara 2022 年 8 月 11 日
It's been a 20 minutes that Matlab is busy to only extract two day 1 and 2. The folder 1 is still empty. How could it be possible to not work in Windows? I have to extract 365 days.

サインインしてコメントする。

その他の回答 (1 件)

Ara
Ara 2022 年 8 月 11 日
Dear Walter,
It works. For folder 1 completely downloaded all data. Thank you very much. Only problem is very slow and gets busy for ~25min for one file. Is there any way to improve it?
  3 件のコメント
Walter Roberson
Walter Roberson 2022 年 8 月 12 日
You are mostly being limited by the speed of your internet connection.
If you change the assignment
td = tempdir();
you could change the download directory to an SSD if you have one. That could potentially make the untar step faster.
Ara
Ara 2022 年 8 月 12 日
編集済み: Ara 2022 年 8 月 12 日
Oh, I see! Yes the internet connection is not very good.
SSD means external memory? Would it be possible to download it all files in it instead of C? I do not know how to change it. Wouldyou please let me know how to change the path to the current folder or specifically in the external memory?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by