Column Headers from Imported Data
19 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
When importing Data from an ASCII file, it only saves one row of text for the column headers but I would like it to save two rows of text as column headers. Both are tab delimited. How do I import the file with two rows of Column Headers?
3 commentaires
Star Strider
le 6 Nov 2019
In readtable, under Text Files Only, see the 'HeaderLines' name-value pair. (Cannot link directly to it.)
Réponses (1)
Subhadeep Koley
le 8 Nov 2019
Hi, refer the example below.
filename = fullfile(matlabroot,'examples','matlab','myCsvTable.dat');
n = 2; % Number of rows to be skipped at the beginning
T = readtable(filename,'HeaderLines',n);
Hope this helps!
0 commentaires
Voir également
Catégories
En savoir plus sur Text Files 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!