How to skip last n rows while reading a csv file using readtable?
43 次查看(过去 30 天)
显示 更早的评论
I have a csv file that I want to read as table in MATLAB using readtable command. However, I know that last few lines are corrupted or not reliable and I want to skip them. How can I do that using readtable. Note that a similar function is available in python's panda package for read.csv by supplying skipfooter.
0 个评论
采纳的回答
Rahul Bhadani
2021-2-16
1 个评论
Venkatkumar M
2022-11-22
How to skip first 20 rows in the csv file?
Could you please give some answer?
更多回答(1 个)
KALYAN ACHARJYA
2021-2-16
编辑:KALYAN ACHARJYA
2021-2-16
This way?
data_table=readtable('filename');
%want to remove n rows from last
n=;...?
data=data_table(1:end-n,:)
4 个评论
Venkatkumar M
2022-11-22
How to skip first 20 rows in the csv file?
Could you please give some answer?
Walter Roberson
2022-11-22
data_table = readtable('filenameGoesHere', 'HeaderLines', 20);
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!