Filter löschen
Filter löschen

Search for excel spreadsheet with name or symbol

1 Ansicht (letzte 30 Tage)
Ghenji
Ghenji am 24 Okt. 2017
Kommentiert: Ghenji am 25 Okt. 2017
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.

Akzeptierte Antwort

Jan
Jan am 24 Okt. 2017
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

Weitere Antworten (0)

Kategorien

Mehr zu Data Export to MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by