필터 지우기
필터 지우기

Importing data from an Excel file on a website

조회 수: 2 (최근 30일)
Brian
Brian 2011년 10월 5일
I am trying to import data from an Excel file on a website (Subversion Repository). I tried and failed with:
PATHNAME_KEY = 'http://XXsvn/XXXXX/XXXXX/XXXXX/XXXXX/'; FILENAME_KEY = 'Key.xlsx';
cd(PATHNAME_KEY)
With Error:
??? Error using ==> cd Cannot CD to http://XXsvn/XXXXX/XXXXX/XXXXX/XXXXX/ (Name is nonexistent or not a directory).
Error in ==> Classification at 66 cd(PATHNAME_KEY)

답변 (2개)

Fangjun Jiang
Fangjun Jiang 2011년 10월 5일
Of course you can not run cd(PATHNAME_KEY) because that url is not a directory. I wonder if you can run
xlsread(fullfile(PATHNAME_KEY,FILENAME_KEY))
  댓글 수: 2
Brian
Brian 2011년 10월 5일
Now, the error is:
??? Error using ==> xlsread at 214
XLSREAD unable to open file
http:\\XXsvn\XXXXX\XXXXX\XXXXX\XXXXX\Key.xlsx.
File http:\\XXsvn\XXXXX\XXXXX\XXXXX\XXXXX\Key.xlsx not found.
Error in ==> Classification at 60
[~,~,raw_KEY] =
xlsread(fullfile(PATHNAME_KEY,FILENAME_KEY),'Key');
Fangjun Jiang
Fangjun Jiang 2011년 10월 5일
Then I guess you can't read an .xls file directly from a web site. You have to download the file first and then read it. That's part of the "http". Web browser can interprets it and get the content using whatever protocol, but not for xlsread().

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2011년 10월 5일
You will need to use urlread() or (probably better for your purpose) urlwrite() .

카테고리

Help CenterFile Exchange에서 Data Export to MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by