Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

How to import an excel file from the web?

Asked by Feng

Feng (view profile)

on 11 Jan 2013

I would like to import an excel spreadsheet which is on the intranet. I can click the file to download it when I am on that page. Now I am able to read the source code of that page using 'urlread', but not sure how to open the actual file.

Any clue?

Thanks,

Feng

0 Comments

Feng

Feng (view profile)

Tags

Products

No products are associated with this question.

2 Answers

Answer by Walter Roberson

Walter Roberson (view profile)

on 11 Jan 2013
Accepted answer

xlsread()

2 Comments

Feng

Feng (view profile)

on 11 Jan 2013

Thanks for the response. How do I refer the file on the internet?

Walter Roberson

Walter Roberson (view profile)

on 12 Jan 2013

urlread() of the download page will allow you to find the URL of the file itself; it will probably be in the form of a file: URL or possibly an http: or https: URL. Once you have extracted that URL, urlread() or urlwrite() the file itself.

Walter Roberson

Walter Roberson (view profile)

Answer by Jan Simon

Jan Simon (view profile)

on 12 Jan 2013
Edited by Jan Simon

Jan Simon (view profile)

on 12 Jan 2013

You can use URLREAD to read the Excel file, store it locally and use XLSREAD then.

Walter 's idea is better: urlwrite performs the storing to disk implicitly.

1 Comment

Walter Roberson

Walter Roberson (view profile)

on 12 Jan 2013

urlwrite() might make more sense than urlread() in this circumstance.

Jan Simon

Jan Simon (view profile)

Contact us