folders containing excel spreadsheets

I have 4 folders each consisting of several (>10) excel spreadsheets. How is it possible to extract the last worksheet of each spreadsheet into matlab. So that in matlab, the data will be such that a cell would represent a folder and within that cell you would have the contents of each folder i.e. the data from the last worksheet of each spreadsheet?
cheers

回答 (1 件)

Robert Cumming
Robert Cumming 2011 年 11 月 30 日

0 投票

doc dir
doc xlsread
doc cell
should give you somewhere to start...

6 件のコメント

ricco
ricco 2011 年 11 月 30 日
Well I've done this so far:
files = dir('*.xls');
%read data from excel into matlab
for i=1:length(files);
File_Name{i}=files(i,1).name;%Removes the file names from 'files'
[num{i},txt,raw] = xlsread1(File_Name{i},'Bass min sond');
end
But I don't know how to obtain data from different folders and then placing them in different cells.
ricco
ricco 2011 年 11 月 30 日
'Bass min sind' refers to the name of the last worksheet in the worksheet.
ricco
ricco 2011 年 11 月 30 日
**sond**
Robert Cumming
Robert Cumming 2011 年 11 月 30 日
your on the right track with what you have. Is your directory names fixed? Or do you want it clever/dynamic?
ricco
ricco 2011 年 11 月 30 日
the folders are all in the same directory.
Robert Cumming
Robert Cumming 2011 年 12 月 1 日
fixed?
clever?
dynamic?
concentrate on loading the data from one file - then expandm rather than trying to solve the problem in one go.

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

タグ

質問済み:

2011 年 11 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by