필터 지우기
필터 지우기

Search for excel spreadsheet with name or symbol

조회 수: 1 (최근 30일)
Ghenji
Ghenji 2017년 10월 24일
댓글: Ghenji 2017년 10월 25일
I am working with Guide and looking for the code that can help me search particular excel spreadsheet. suppose there are 7 sheets with names.. Circle..Parabola..Triangle..~Data1..~Data2..Ellipse..~Data3
Now what i want is that..code should search for only spreadsheet starting with symbol '~' (tilde). so I could load data only from Spreadsheets ~Data1 ~Data2 ~Data3 and so on and also numbering of these sheets is random since am having 50 excel files with ~Data1 to ~Data15 spreadsheets. hence xlsread(..,sheet) this does not work. Glad to know if its possible.

채택된 답변

Jan
Jan 2017년 10월 24일
The function xlsfinfo gives you a list of the sheet names:
[status, sheets] = xlsfinfo(filename);
Then find the sheet names starting with a ~:
sheetIndex = find(strncmp(sheets, '~', 1));
Now you can load this sheets:
for iSheet = sheetIndex % Perhaps sheetIndex(:).'
Data = xlsread(FileName, iSheet);
...
end

추가 답변 (0개)

카테고리

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