deleting the entire line starting from 0,0,0 from a huge text file

1 view (last 30 days)
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?

Answers (1)

Luna
Luna on 31 Jan 2019
Try this:
A(all((A(:,[1:3]) == [0 0 0])')',:) = [];
Where A is the Nx6 double array from your text file.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!