Extracting data from excel
6 views (last 30 days)
Show older comments
Hi I would like to extract data from a column in which the second row contains string "P5" (Figure attached). One way is to use "xlsread('filepath/data.csv','DQ:DQ')". In this case one need to look at corresponding excel column index, i.e., "DQ". Is there a way in which one can extract data without looking at excel column index but using the string index, i.e., "P4" instead ?
0 Comments
Answers (1)
dpb
on 17 Apr 2017
With "pure" Matlab-supplied functions, no. You would have to do it indirectly, reading the header row then finding the desired string location therein. As xlsread is quite slow already, almost surely at least as fast to simply just read the full sheet and save what you're interested in.
I'm sure it's also possible with COM to write specific commands but that becomes an Excel VBA syntax problem, not Matlab once the automation server is created.
0 Comments
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!