Effacer les filtres
Effacer les filtres

Extracting data from excel

2 vues (au cours des 30 derniers jours)
Salaijobhaka
Salaijobhaka le 17 Avr 2017
Réponse apportée : dpb le 17 Avr 2017
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 ?

Réponses (1)

dpb
dpb le 17 Avr 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.

Community Treasure Hunt

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

Start Hunting!

Translated by