# Remove strings invading my list of numbers

I have a list of x,y,z coordinates from a wavefront sensor I'm working with. However, not all of the imported points have actual values, but they still get imported as {x,y, NaN}. I'm trying to find a way to get rid of these faulty points, but so far, I can't find a way to identify them. They don't affect some graphs, but I've run into trouble when performing operations on the set of points

I've tried several things like Delete, DeleteCases and StringTrim, but to no avail.

When I run, DeleteCases[graph, " NaN"], for example, I get back the same set of points.

Also, I am using Mathematica 7.

Thanks.

-
On one of the erroneous data points, would run FullForm and post the result? –  rcollyer Jun 25 at 21:12
I have never seen Mathematica Imports return NaN. This must be a remnant of another program. Anyway, DeleteCases should be able to get rid of them. Please provide the code you tried, otherwise we can't comment on what you did wrong. –  Sjoerd C. de Vries Jun 25 at 21:18
Here is the FullForm for one point:{-1.35714, -1.21429, 0.25 (-0.699 + " NaN")} So far I have tried Delete and DeleteCases, I am new to Mathematica, so I have not explored much else. Thank for your help. –  Brent Jun 25 at 21:54
Try Cases[{{1, 2, 3}, {-1.35714, -1.21429, 0.25 (-0.699 + " NaN")}}, {_, _, _?NumberQ}] or DeleteCases[{{1, 2, 3}, {-1.35714, -1.21429, 0.25 (-0.699 + " NaN")}}, {_, _, _?(Not[NumberQ[#]] &)}] –  Sjoerd C. de Vries Jun 25 at 22:05
Works like a charm! Thank you so much. I will have to familiarize myself with this notation further. –  Brent Jun 25 at 22:12
show 1 more comment