How do I count the number of columns in a csv file?
15 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am trying to iterate through the number of columns as well as rows in an excel document. How do i assign a variable called numCols that stores the number of Columns with data in a csv file?
0 Commenti
Risposte (1)
Walter Roberson
il 24 Nov 2019
datatable = readtable('YourFile.csv', 'ReadVariableNames', false); %or true if there is a header
numRows = height(datatable);
numCols = width(datatable);
0 Commenti
Vedere anche
Categorie
Scopri di più su MATLAB Report Generator in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!