Reading an element from Excel files
显示 更早的评论
I want to read a particular element from an Excel file which has for example 500 rows and 3 columns. I am interested in the element in the 200th row and second column. I have 1000 of these files in a particular folder. How do I read and extract this particular element from all the files so I could analyse and plot a graph with what's extracted instead of manually going through each of the 1000 files to get these elements? Thank you Uche
回答(1 个)
Geoff Hayes
2014-10-27
Elijah - try using xlsread to get the 200th element of the second column. If you have a list of *.xlsx files, then as you iterate through this list, just read the single element from each file and store it in an array
x(k) = xlsread(myFilename,'B200');
myFilename is just a local variable representing the kth filename (say, 'myFileK.xlsx'). You may need to supply the worksheet name before the 'B200' string. See the xlsread documentation for details.
类别
在 帮助中心 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!