deleting the entire line starting from 0,0,0 from a huge text file
1 次查看(过去 30 天)
显示 更早的评论
I have collected a huge data set and want to clear that dataset.
it is something like this-
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
-0 0 0 0 1 0
-0 0 0 0 1 0
18.2375 202.634 544.567 0 1 0
19.0986 202.448 544.067 0 1 0
19.9764 202.448 544.067 0 1 0
20.8398 202.308 543.692 0 1 0
21.6971 202.122 543.192 0 1 0
22.5579 201.983 542.817 0 1 0
23.4337 201.983 542.817 0 1 0 ........
i only want to keep the points and want to delete each line starting from 0,0,0 or -0,0,0
Can anyone help please?
回答(1 个)
Luna
2019-1-31
Try this:
A(all((A(:,[1:3]) == [0 0 0])')',:) = [];
Where A is the Nx6 double array from your text file.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!