Is there a way to automatically extract as many header columns as is available? Each csv file will have a different number of header columns.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
LabRat
le 27 Juil 2022
Réponse apportée : Walter Roberson
le 27 Juil 2022
Example:
If I wanted to add header columns 2 to 4, I would use:
header = bud_serials.Properties.VariableNames;
app.SelectTestID.Items = header(2:4);
However, if the number of header columns changes each time, how would I automatially extract the available header columns that exist. Each CSV file I extract from will have a different number of header colunns.
0 commentaires
Réponse acceptée
Walter Roberson
le 27 Juil 2022
app.SelectTestID.Items = header(2:end);
will skip the first column and give you the names of the rest.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Import and Export dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!