Text file row-column formatting

I have this text file, It contains 3 columns. I want to remove all those rows whose third column element is 0...
So, how to do it..?

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 4 Dez. 2012
Bearbeitet: Walter Roberson am 4 Dez. 2012

0 Stimmen

YourData = load('3d.txt');
YourData(YourData(:,3) == 0, :) = [];
save('New3d.txt', 'YourData', '-ascii');

2 Kommentare

Lalit Patil
Lalit Patil am 4 Dez. 2012
It shows this kind of error.
??? Index of element to remove exceeds matrix dimensions.
Walter Roberson
Walter Roberson am 4 Dez. 2012
Sorry I have edited the above to fix the problem.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by