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!