How do I count the number of rows in a csv file?
10 views (last 30 days)
Show older comments
Jasmine Shah
on 23 Nov 2019
Answered: Walter Roberson
on 23 Nov 2019
I am trying to iterate through the number of rows in a certain column in an excel document. How do i assign a variable called numRows that stores the number of rows with data in a csv file?
0 Comments
Accepted Answer
Walter Roberson
on 23 Nov 2019
datatable = readtable('YourFile.csv', 'ReadVariableNames', false); %or true if there is a header
numRows = height(datatable);
0 Comments
More Answers (0)
See Also
Categories
Find more on Workspace Variables and MAT Files 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!