how to download zip files, unzip XLS, and load into MATLAB

1 visualización (últimos 30 días)
Lawrence
Lawrence el 3 de Mayo de 2013
Respondida: Richard Zapor el 16 de Nov. de 2013
I am trying to access the website:
is there any matlab code that can list the filenames on the website, download & unizp, then initiate a script to read the contained XLS files into MATLAB????
any help gratefullly appreciated

Respuestas (1)

Richard Zapor
Richard Zapor el 16 de Nov. de 2013
function site_read_zip
%
% place self in write directory
web='http://www.nemweb.com.au/REPORTS/CURRENT/HistDemand/';
str=urlread(web); % read page source
% cell array of file names with an extra < symbol
% this can be done better
fn=regexpi(str,'PUBLIC[A-Z_0-9]+.zip<','match');
for k=1:size(fn,2)
file=fn{k};
unzip([web file(1:end-1)]);
end
% to read csv file use dir to get fnames and csvread
end

Categorías

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

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by