Importing Data from excel across multiple sheets and filenames.
이전 댓글 표시
I am attempting to import multiple strings of data from excel spread sheets and was hoping that the same ranges across multiple sheets could be imported with the same command.
Was thinking it would be a for loop but was unsure how to set it up best.
A total of 8 data sets will be imported from 12 sheets. Any help is greatly appreciated or any questions. :)
댓글 수: 3
Azzi Abdelmalek
2016년 8월 25일
8 data sets will be imported from 12 sheets. What does that mean?
Guillaume
2016년 8월 25일
Yes, you can pass the same range to each call of xlsread, just as you can pass the same arguments to each call of a function.
It's very unclear what problem you are having.
Declan Simons
2016년 8월 25일
편집: Declan Simons
2016년 8월 25일
채택된 답변
추가 답변 (2개)
Kristian Opsahl
2018년 9월 12일
1 개 추천
Hi,
This code worked fine to import my data. However it does not import the dates that I have in column A on every sheet. Any workaround/solution to that?
댓글 수: 1
NAGENDRA ACHANTA
2019년 11월 7일
Use [~,~,data{k}] instead of data{k}
Carlos Riascos
2023년 2월 17일
0 개 추천
I would recommend something like this:
[~,sheet_name]=xlsfinfo('filename.xlsx')
for k=sheet_name
[~,~,data.(k{1})]=xlsread('filename.xlsx',k{1});
end
Note: be careful with not having spaces or unallowed symbols in the sheet_name, otherwise use the command replace.
카테고리
도움말 센터 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!