[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How do you select only specific rows based on the values in a specific c
From: |
Thompson, Robert M - (rmt1) |
Subject: |
How do you select only specific rows based on the values in a specific column? |
Date: |
Sun, 26 Oct 2014 00:29:54 +0000 |
I have a huge source file of a million lines, like: (cartographic data)
0.015625 89.996094 0.018000
0.046875 89.996094 0.018000
0.078125 89.996094 0.018000
0.109375 89.996094 0.018000
0.140625 89.996094 0.018000
0.171875 89.996094 0.018000
0.203125 89.996094 0.018000
0.234375 89.996094 0.018000
0.265625 89.996094 0.018000
0.296875 89.996094 0.018000
I was using C to pare the source file down into a smaller file based on values
in first and second column.
The evaluation was like, e.g., keep this row if column 1 is greater than
0.20000 and column 2 is >= 89.00000.
Then I was loading that NEW file (XYZ) into octave, using...
load XYZ;x=XYZ(:,1);y=XYZ(:,2);z=XYZ(:,3);
...and EVERY record of XYZ was necessary, and every single x, y and z was data
I required.
But now I want to cut out the C middleman and import the million-line source
file directly into Octave.
But also select only the rows with first or second columns matching criteria,
before I consume great amounts of memory on records I will not be using.
Any small examples?
Thank you
Robert
- How do you select only specific rows based on the values in a specific column?,
Thompson, Robert M - (rmt1) <=