フィルターのクリア

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
  1 件のコメント
Ghenji
Ghenji 2017 年 10 月 25 日
Thank you Jan. This is indeed working.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by