Borrar filtros
Borrar filtros

Download a file from a website?

12 visualizaciones (últimos 30 días)
Ara
Ara el 6 de Ag. de 2022
Editada: Ara el 12 de Ag. de 2022
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?

Respuesta aceptada

Walter Roberson
Walter Roberson el 6 de Ag. de 2022
Editada: Walter Roberson el 6 de Ag. de 2022
  22 comentarios
Walter Roberson
Walter Roberson el 11 de Ag. de 2022
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 el 11 de Ag. de 2022
Editada: Ara el 11 de Ag. de 2022
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.

Iniciar sesión para comentar.

Más respuestas (1)

Ara
Ara el 11 de Ag. de 2022
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 comentarios
Walter Roberson
Walter Roberson el 12 de Ag. de 2022
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 el 12 de Ag. de 2022
Editada: Ara el 12 de Ag. de 2022
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?

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by